title: Android Studio retrieve information from XML in a override method
body: <p>Sorry for the noob question but I did not come across any situations that would work for me. Im sure this is super simple, I just need to be pointed in the right direction.</p>
  
  <p>Objective:<br>
  I want to be able to take the name of what the user specified and add it to the markers title.</p>
  
  <p>What I know:<br>
  I am unable to inflate the xml and grab it via that way cause the method is being override and if I inflate to my knowledge will no longer allow me to override the method. How should I approach this?</p>
  
  <p>MapsAcitivy</p>
  
  <pre><code>public class MapsActivity extends FragmentActivity implements OnMapReadyCallback, addPlace.Communicator {
  
      private GoogleMap mMap;
      public static final int MY_PERMISSION_ACCESS_FINE_LOCATION = 0;
      int mStackLevel;
      int YES_NO_CALL;
      FragmentManager manager = getSupportFragmentManager();
      final Context context = this;
  
      @InjectView(R.id.btn_login) Button _loginButton;
  
      ClusterManager&lt;ClusterRequest&gt; mClusterManager;
  
  
      class CustomInfoWindowAdapter implements GoogleMap.InfoWindowAdapter {
  
          // These are both viewgroups containing an ImageView with id "badge" and two TextViews with id
          // "title" and "snippet".
          private final View mWindow;
  
          //private final View mContents;
  
          CustomInfoWindowAdapter() {
              mWindow = getLayoutInflater().inflate(R.layout.info_window_layout, null);
              //mContents = getLayoutInflater().inflate(R.layout.custom_info_contents, null);
          }
  
          @Override
          public View getInfoWindow(Marker marker) {
              render(marker, mWindow);
              return mWindow;
          }
  
          @Override
          public View getInfoContents(Marker marker) {
              // Getting view from the layout file info_window_layout
              View v = getLayoutInflater().inflate(R.layout.info_window_layout, null);
  
              // Getting the position from the marker
              LatLng latLng = marker.getPosition();
  
              // Getting reference to the TextView to set latitude
              TextView tvLat = (TextView) v.findViewById(R.id.tv_lat);
  
              // Getting reference to the TextView to set longitude
              TextView tvLng = (TextView) v.findViewById(R.id.tv_lng);
  
              // Setting the latitude
              tvLat.setText("Latitude:" + latLng.latitude);
  
              // Setting the longitude
              tvLng.setText("Longitude:"+ latLng.longitude);
  
              // Returning the view containing InfoWindow contents
              return v;
              //render(marker, mContents);
              //return mContents;
          }
  
          private void render(Marker marker, View view) {
          }
      }
  
  
      @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
      @TargetApi(23)
      public void onMapReady(GoogleMap googleMap) {
          mMap = googleMap;
  
          // Here, thisActivity is the current activity
          if (ContextCompat.checkSelfPermission(this,
                  Manifest.permission.ACCESS_FINE_LOCATION)
                  != PackageManager.PERMISSION_GRANTED) {
  
              // Should we show an explanation?
              if (ActivityCompat.shouldShowRequestPermissionRationale(this,
                      Manifest.permission.ACCESS_FINE_LOCATION)) {
  
                  // Show an expanation to the user *asynchronously* -- don't block
                  // this thread waiting for the user's response! After the user
                  // sees the explanation, try again to request the permission.
  
              } else {
  
                  // No explanation needed, we can request the permission.
  
                  ActivityCompat.requestPermissions(this,
                          new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
                          MY_PERMISSION_ACCESS_FINE_LOCATION);
  
                  // MY_PERMISSION_ACCESS_FINE_LOCATION is an
                  // app-defined int constant. The callback method gets the
                  // result of the request.
              }
          }
          if (ContextCompat.checkSelfPermission(this,
                  Manifest.permission.ACCESS_FINE_LOCATION)
                  == PackageManager.PERMISSION_GRANTED) {
              mMap.setMyLocationEnabled(true);
              LocationManager initialLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
              Criteria criteria = new Criteria();
              String initialProvider = initialLocationManager.getBestProvider(criteria, true);
              Location initialLocation = initialLocationManager.getLastKnownLocation(initialProvider);
              mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
              double initialLatitude = initialLocation.getLatitude();
              double initialLongitude = initialLocation.getLongitude();
              LatLng initialLatLng = new LatLng(initialLatitude, initialLongitude);
              mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(initialLatLng, 14.9f));
              //mMap.setOnInfoWindowClickListener(this);
              mClusterManager = new ClusterManager&lt;ClusterRequest&gt;(getApplicationContext(), mMap);
              mMap.setOnCameraChangeListener(mClusterManager);
              mMap.setOnMarkerClickListener(mClusterManager);
          }
      }
  
      public void onButtonClick(View view){
          //do something when button is clicked.
          final Dialog dialog = new Dialog(this);
          dialog.setContentView(R.layout.add_place);
          dialog.setTitle("Add Place");
  
          Button btnLogin = (Button) dialog.findViewById(R.id.addPlacebtnSubmit);
          Button btnCancel = (Button) dialog.findViewById(R.id.btnCancel);
          final EditText txtUsername = (EditText)dialog.findViewById(R.id.txtStopName);
  
          // Attached listener for add place GUI button
          btnLogin.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  String stopName = txtUsername.getText().toString();
                  if(stopName.length() &gt; 4){
                      // Here, thisActivity is the current activity
                      if (ContextCompat.checkSelfPermission(MapsActivity.this,
                              android.Manifest.permission.ACCESS_FINE_LOCATION)
                              != PackageManager.PERMISSION_GRANTED) {
  
                          // Should we show an explanation?
                          if (ActivityCompat.shouldShowRequestPermissionRationale(MapsActivity.this,
                                  android.Manifest.permission.ACCESS_FINE_LOCATION)) {
  
                              // Show an expanation to the user *asynchronously* -- don't block
                              // this thread waiting for the user's response! After the user
                              // sees the explanation, try again to request the permission.
  
                          } else {
  
                              // No explanation needed, we can request the permission.
  
                              ActivityCompat.requestPermissions(MapsActivity.this,
                                      new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},
                                      MY_PERMISSION_ACCESS_FINE_LOCATION);
  
                              // MY_PERMISSION_ACCESS_FINE_LOCATION is an
                              // app-defined int constant. The callback method gets the
                              // result of the request.
                          }
                      }
                      LocationManager currentLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
                      Criteria currentCriteria = new Criteria();
                      String currentProvider = currentLocationManager.getBestProvider(currentCriteria, true);
                      Location currentLocation = currentLocationManager.getLastKnownLocation(currentProvider);
                      double currentLatitude = currentLocation.getLatitude();
                      double currentLongitude = currentLocation.getLongitude();
                      LatLng currentLatLng = new LatLng(currentLatitude, currentLongitude);
  
                      ClusterRequest testCluster = new ClusterRequest(currentLatitude, currentLongitude);
                      mClusterManager.addItem(testCluster);
                      mClusterManager.setRenderer(new MapIconRender(getApplicationContext(), mMap, mClusterManager));
  
                      dialog.dismiss();
  
                  }
                  else{
                      txtUsername.setError("Stop name must be at least 5 characters long.");
                  }
              }
          });
  }
  </code></pre>
  
  <p>MapIconRender.java</p>
  
  <pre><code>public class MapIconRender extends DefaultClusterRenderer&lt;ClusterRequest&gt; {
  
          public MapIconRender(Context context, GoogleMap map,
                               ClusterManager&lt;ClusterRequest&gt; clusterManager) {
              super(context, map, clusterManager);
          }
  
              @Override
              protected void onBeforeClusterItemRendered (ClusterRequest item, MarkerOptions
              markerOptions){
                  markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.map_marker_outside_azure));
                  markerOptions.snippet("Status: ");
                  markerOptions.title(stopName); //&lt;------ THIS IS WHERE I WANT THE STOP NAME TO BE WHAT THE USER ENTERED.
                  super.onBeforeClusterItemRendered(item, markerOptions);
              }
  }
  </code></pre>
  
  <p>add_place.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_height="match_parent"
      android:paddingLeft="10dp" android:paddingRight="10dp"
      android:background="#fff" android:layout_width="300dp"
      android:paddingTop="10dp"&gt;
      &lt;View
          android:id="@+id/HorizontalLine"
          android:layout_width="match_parent"
          android:layout_height="1dip"
          android:background="#aaa" /&gt;
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:text="Name:"
          android:paddingTop="20dp"
          android:id="@+id/name" /&gt;
      &lt;EditText android:layout_height="wrap_content"
          android:id="@+id/txtStopName"
          android:maxLength="100"
          android:singleLine="true"
          android:hint="Name of this stop (5-100 characters)"
          android:layout_width="match_parent"&gt;
          &lt;requestFocus&gt;&lt;/requestFocus&gt;
      &lt;/EditText&gt;
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:text="Type:"
          android:paddingTop="20dp"
          android:layout_marginBottom="10dp"
          android:id="@+id/type" /&gt;
  
      &lt;Spinner
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/spinner"
          android:entries="@array/type_arrays"
          android:prompt="@string/type_prompt"
          android:layout_marginBottom="10dp"/&gt;
      &lt;View
          android:id="@+id/HorizontalLine2"
          android:layout_width="match_parent"
          android:layout_height="1dip"
          android:background="#aaa" /&gt;
      &lt;LinearLayout android:layout_width="match_parent"
          android:layout_height="wrap_content" android:id="@+id/linearLayout1"
          android:paddingTop="5dp"&gt;
  
          &lt;Button android:layout_width="wrap_content"
              android:layout_height="wrap_content" android:layout_weight="0.5"
              android:id="@+id/btnCancel" android:text="Cancel"
              android:onClick="addPlaceCancel"/&gt;
          &lt;Button android:layout_width="wrap_content"
              android:layout_height="wrap_content" android:layout_weight="0.5"
              android:id="@+id/addPlacebtnSubmit" android:text="Submit"
              android:onClick="addPlaceSubmit"
              android:layout_marginBottom="10dp"/&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>ClusterRequest.java
  <br></p>
  
  <pre><code>public class ClusterRequest implements ClusterItem {
  private final LatLng mPosition;
  
  public ClusterRequest(double lat, double lng) {
      mPosition = new LatLng(lat, lng);
  }
  
  @Override
  public LatLng getPosition() {
      return mPosition;
    }
  }
  </code></pre>