I need the telephone number of the workshops to appear in the dialer in the information box and for the user to be able to click on it and call. This is the code where I position the markers on the map. I bring the markers from a Rest Api with all their information with an AsyncTask
This is where I call the AsynTask
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
new MapsActivity.PeticionTask().execute(new String[]{TallerPrincipalActivity.linkCampico+"/talleres","GET"});
}
//Y en el PostExecute es donde cargo los puntos en el mapa recorriendo un //arrayList
@Override
protected void onPostExecute(ArrayList<Taller> s) {
super.onPostExecute(s);
Log.e("mapas",""+talleres);
for(int i=0;i<s.size();i++){
// Toast.makeText(MapsActivity.this, ""+s.get(i).getLatitud()+" "+s.get(i).getLongitud(), Toast.LENGTH_SHORT).show();
LatLng punto1 = new LatLng(s.get(i).getLatitud(), s.get(i).getLongitud());
Marker puntos = mMap.addMarker(new MarkerOptions()
.position(punto1)
.title(s.get(i).getNombre()+" "+i)
.snippet(s.get(i).getDireccion()));
puntos.showInfoWindow();
}
}
}
to your marker assign an object with
setTag()
You must override the method
setOnMarkerClickListener
:Remember that you must have
Manifest.xml
the permitAnd it depends on your android version to ask for it at runtime