Android set address (name of location) from current location in marker's title
<p>I want to get the address from the current location and put in the marker's title. For now I only have the .title("Tu ubicación")).showInfoWindow(); but I want to change it for the address</p>

<p>Here's my code:</p>

<pre><code>public class Request extends Fragment implements LocationListener {
private FragmentActivity myContext;

public static final String ARG_REQUEST = "arg_request";

public Request() {
    // Empty constructor required for fragment subclasses
}
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.request, container, false);
    // Gets the MapView from the XML layout and creates it

    switch (GooglePlayServicesUtil.isGooglePlayServicesAvailable(getActivity()) )
    {
        case ConnectionResult.SUCCESS:
            mapView = (MapView) v.findViewById(R.id.googleMap);
            mapView.onCreate(savedInstanceState);
            // Gets to GoogleMap from the MapView and does initialization stuff
            if(mapView!=null)
            {
                map = mapView.getMap();
                map.getUiSettings().setMyLocationButtonEnabled(false);
                map.setMyLocationEnabled(true);
                LocationManager locationManager = (LocationManager) myContext.getSystemService(myContext.LOCATION_SERVICE);
                Criteria criteria = new Criteria();
                String bestProvider = locationManager.getBestProvider(criteria, true);
                Location location = locationManager.getLastKnownLocation(bestProvider);
                if (location != null) {
                    onLocationChanged(location);
                }
                locationManager.requestLocationUpdates(bestProvider, 20000, 0, this);
            }
            break;
        case ConnectionResult.SERVICE_MISSING:
            break;
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            break;
        default:
    }
    // Updates the location and zoom of the MapView

    return v;
}

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);
}

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    // TODO Add your menu entries here
    inflater.inflate(R.menu.main, menu);
    super.onCreateOptionsMenu(menu, inflater);
}

@Override
public void onResume() {
    mapView.onResume();
    super.onResume();
}
@Override
public void onDestroy() {
    super.onDestroy();
    mapView.onDestroy();
}
@Override
public void onLowMemory() {
    super.onLowMemory();
    mapView.onLowMemory();
}

@Override
public void onLocationChanged(Location location) {
    map.clear();
    double latitude = location.getLatitude();
    double longitude = location.getLongitude();
    LatLng latLng = new LatLng(latitude, longitude);
    map.addMarker(new MarkerOptions()
            .position(latLng)
            .icon(BitmapDescriptorFactory.fromResource(R.drawable.car))
            .title("Tu ubicación")).showInfoWindow();
    map.moveCamera(CameraUpdateFactory.newLatLng(latLng));
    map.animateCamera(CameraUpdateFactory.zoomTo(15));
}
</code></pre>

<p>And the xml:</p>

<p></p>

<pre><code>&lt;RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="150dp"
    android:id="@+id/relativeLayout"&gt;

    &lt;com.google.android.gms.maps.MapView
        android:id="@+id/googleMap"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" /&gt;
&lt;/RelativeLayout&gt;

&lt;ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageViewPerfilPersona"
    android:src="@drawable/perfil_persona_b"
    android:layout_alignParentTop="true"
    android:layout_alignRight="@+id/textViewClientName"
    android:layout_alignEnd="@+id/textViewClientName"
    android:layout_marginTop="112dp" /&gt;

&lt;TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="@string/ClientName"
    android:id="@+id/textViewClientName"
    android:layout_below="@+id/imageViewPerfilPersona"
    android:layout_centerHorizontal="true" /&gt;

&lt;TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="@string/TimeLeftRequest"
    android:id="@+id/textViewTimeLeft"
    android:layout_below="@+id/textViewClientName"
    android:layout_centerHorizontal="true" /&gt;

&lt;ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageViewCar"
    android:src="@drawable/car"
    android:paddingRight="5dp"
    android:paddingTop="0dp"
    android:paddingBottom="0dp"
    android:layout_alignTop="@+id/textViewTypeCar"
    android:layout_toStartOf="@+id/textViewTypeCar"
    android:layout_alignBottom="@+id/textViewTypeCar"
    android:layout_toLeftOf="@+id/textViewTypeCar" /&gt;

&lt;TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="@string/TypeCar"
    android:id="@+id/textViewTypeCar"
    android:paddingLeft="20dp"
    android:layout_marginTop="30dp"
    android:layout_below="@+id/textViewTimeLeft"
    android:layout_centerHorizontal="true"
    android:paddingTop="0dp"
    android:paddingRight="10dp"
    android:paddingStart="20dp"
    android:paddingEnd="10dp" /&gt;

&lt;TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="@string/I_need"
    android:id="@+id/textViewI_need"
    android:layout_below="@+id/textViewTypeCar"
    android:layout_alignLeft="@+id/textViewTypeCar"
    android:layout_alignStart="@+id/textViewTypeCar"
    android:layout_marginTop="15dp"
    android:paddingLeft="20dp"
    android:paddingRight="10dp"
    android:paddingStart="20dp"
    android:paddingEnd="10dp" /&gt;

&lt;ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageViewTire"
    android:layout_below="@+id/imageViewCar"
    android:layout_alignLeft="@+id/imageViewCar"
    android:layout_alignStart="@+id/imageViewCar"
    android:src="@drawable/tire"
    android:layout_alignBottom="@+id/textViewI_need"
    android:layout_alignRight="@+id/imageViewCar"
    android:layout_alignEnd="@+id/imageViewCar"
    android:layout_alignTop="@+id/textViewI_need" /&gt;

&lt;TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="@string/ClientLocation"
    android:id="@+id/textViewLocation"
    android:layout_below="@+id/textViewI_need"
    android:layout_alignLeft="@+id/textViewI_need"
    android:layout_alignStart="@+id/textViewI_need"
    android:layout_marginTop="15dp"
    android:paddingLeft="20dp"
    android:paddingRight="10dp"
    android:paddingStart="20dp"
    android:paddingEnd="10dp"/&gt;

&lt;ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageViewLocation"
    android:layout_alignLeft="@+id/imageViewTire"
    android:layout_alignStart="@+id/imageViewTire"
    android:src="@drawable/map"
    android:layout_alignBottom="@+id/textViewLocation"
    android:layout_alignRight="@+id/imageViewTire"
    android:layout_alignEnd="@+id/imageViewTire"
    android:layout_alignTop="@+id/textViewLocation" /&gt;

&lt;ImageButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageButtonCheck"
    android:src="@drawable/check"
    android:background="@null"
    android:onClick="requestCheckButton"
    android:layout_alignParentBottom="true"
    android:layout_alignRight="@+id/textViewTypeCar"
    android:layout_alignEnd="@+id/textViewTypeCar"
    android:layout_marginBottom="38dp" /&gt;

&lt;TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="@string/WaitResponse"
    android:id="@+id/textViewResponse"
    android:layout_below="@+id/textViewLocation"
    android:layout_alignLeft="@+id/textViewLocation"
    android:layout_alignStart="@+id/textViewLocation"
    android:layout_marginTop="15dp"
    android:paddingLeft="20dp"
    android:paddingRight="10dp"
    android:paddingStart="20dp"
    android:paddingEnd="10dp"
    android:visibility="invisible"
    android:onClick="requestSent"/&gt;

&lt;ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageViewResponse"
    android:layout_alignTop="@+id/textViewResponse"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:src="@drawable/wait_response"
    android:layout_alignBottom="@+id/textViewResponse"
    android:layout_alignRight="@+id/imageViewLocation"
    android:layout_alignEnd="@+id/imageViewLocation"
    android:visibility="invisible" /&gt;

&lt;Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/BeginService"
    android:id="@+id/buttonBeginService"
    android:layout_alignTop="@+id/imageButtonCheck"
    android:layout_centerHorizontal="true"
    android:visibility="invisible"
    android:onClick="beginService"/&gt;
</code></pre>

<p></p>

<p><a href="https://i.stack.imgur.com/toHrT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/toHrT.jpg" alt="Here&#39;s a image from the layout"></a></p>