I want to open a new activity when I click on the marker, but I click and it is not opening, I did something like this:
@Override
public boolean onMarkerClick (final Marker marker){
if (marker.equals("Ponto A")){
Intent i = new Intent(Mapa.this, Tela1.class);
startActivity(i);
}else if (marker.equals("Ponto B")){
Intent i = new Intent(Mapa.this, Tela2.class);
startActivity(i);
}
return true;
}
But it's not open yet, can you help me?
I did this
@Override
public boolean onMarkerClick(final Marker marker) {
if (marker.getTitle().equals(Log.d("onMarkerClick","Ponto A"))) {
Intent i= new Intent(Maps.this, Tela1.class);
startActivity(i);
}else if (marker.getTitle().equals(Log.d("onMarkerClick","Ponto B"))) {
Intent i= new Intent(Maps.this, Tela2.class);
startActivity(i);
}
return true;
}
You did not get it, what do I do?