title: How to receive latitude and longitude data stored from Firebase and put it in a marker
body: <p>I'm making an app with firebase and google maps
  But I'm implementing this:</p>
  
  <p>In the AddActivity activity, you set the latitude and longitude by clicking on a certain part of the map by placing a marker
  When you press the "send" button these data are sent to the firebase</p>
  
  <p>And I would like to rescue the data of that marker that was sent as the title,
  And that it is placed in the map of the MainActivity with the latitude and longitude that is in the firebase</p>
  
  <p>This is how my database is organized</p>
  
  <p><a href="https://i.stack.imgur.com/V3waw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V3waw.png" alt="Dbphoto"></a></p>
  
  <p>I need to get the coordinates of the database, and with those coordinates a marker is placed in the exact place</p>
  
  <p>the relevant code:</p>
  
  <p>the addActivity method that send the information</p>
  
  <pre><code>    private void sendPostEvent(){
      FirebaseUtils.getUserRef(FirebaseUtils.getCurrentUser().getEmail().replace(".",",")).addListenerForSingleValueEvent(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              User user = dataSnapshot.getValue(User.class);
              final String postuid = FirebaseUtils.getUid();
  
              String organizadoPor = etOrganizadoPor.getText().toString();
              String tituloEvento = etTituloEvento.getText().toString();
              String descripcionEvento = etDescripcion.getText().toString();
              String costoEvento = etCosto.getText().toString();
  
              mPost.setOrganizadoPor(organizadoPor);
              mPost.setMes(mPost.getMes());
              mPost.setDia(mPost.getDia());
              mPost.setHora(mPost.getHora());
              mPost.setMinutos(mPost.getMinutos());
              mPost.setTitulo(tituloEvento);
              mPost.setDescripicion(descripcionEvento);
              mPost.setCosto(costoEvento);
  
              mPost.setLatitud(mPost.getLatitud());
              mPost.setLongitud(mPost.getLongitud());
  
                 }
  </code></pre>
  
  <p>the MainActivity method:
  when the sendMethod is used i need to put a marker in the MainActivity map</p>
  
  <pre><code>            @Override
  public void onMapReady(GoogleMap googleMap) {
      mMap = googleMap;
      mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
      UiSettings uiSettings = mMap.getUiSettings();
      uiSettings.setZoomControlsEnabled(true);
  
      if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
  
          TastyToast.makeText(NavActivity.this, "GPS permission are not enabled", TastyToast.LENGTH_LONG, TastyToast.ERROR).show();
  
          return;
      }
  
  
      mMap.setMyLocationEnabled(true);
  
  
  
  
  }
  </code></pre>
  
  <p>my database methods:</p>
  
  <pre><code> // POST REFERENCE
  public static DatabaseReference getPostRef() {
      return FirebaseDatabase.getInstance()
              .getReference("Pk");
  }
  public static Query getPostQuery() {
      return getPostRef().orderByChild("Tc");
  }
  public static DatabaseReference getMyPostRef() {
      return FirebaseDatabase.getInstance().getReference("Mp")
              .child(getCurrentUser().getEmail().replace(".", ","));
  }
  </code></pre>