title: Adding Multiple Markers Google Maps
body: <p>I am trying to add a marker all depending on what activity the user is on. For example, if the user is in the location1 activity and clicks the button to open maps, it should open Google Maps with a marker at where location1 is. Alternatively, if the user is in the location2 activity and clicks the button to open maps, it should open Google Maps with a marker at where location 2 is. </p>
  
  <p>I have it working when they click on one activity, it brings them to Google Maps and has a marker at where that location is. I have simply tried to copy the code and paste it below with the edited names in it, but if I click a different activity to go to maps, it brings me to the same marker as previously.</p>
  
  <p>My Code for GoogleMapsActivity is below:</p>
  
  <pre><code>public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
  
  private GoogleMap mMap;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_maps);
  
      // Obtain the SupportMapFragment and get notified when the map is ready to be used.
      SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
      mapFragment.getMapAsync(this);
  }
  
  @Override
  public void onMapReady(GoogleMap googleMap) {
      mMap = googleMap;
  
      //mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
  
      // Add a marker at the Oval and move the camera
      LatLng oval = new LatLng(53.3484013, -6.2605243);
      mMap.addMarker(new MarkerOptions().position(oval).title("Oval Pub"));
      mMap.moveCamera(CameraUpdateFactory.newLatLng(oval));
  
      /*
      // Add a marker at Diceys and move the camera
      LatLng diceys = new LatLng(53.3358088,-6.2636688);
      mMap.addMarker(new MarkerOptions().position(diceys).title("Diceys Nightclub"));
      mMap.moveCamera(CameraUpdateFactory.newLatLng(diceys));
      */
  }
  
  public void changeType(View view)
  {
      if(mMap.getMapType() == GoogleMap.MAP_TYPE_NORMAL)
      {
          mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
      }
      else
          mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
  }}
  </code></pre>
  
  <p>As you can see, I have commented out the code where I have tried adding a marker for a different location, but it seems to bring me to the same location as above. </p>
  
  <p>Not sure if this is something simple or not as I am new to Google Maps in Android.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Thank you.</p>