2
i want to open a new Activity when clicking on the Marketer, however I click and it is not opening, I did more or less 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, you can help me??
i did it
@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;
}
That’s not how I do it?
If you don’t put any if, it opens an Activity?
– Shogogan
but if I didn’t put any if, which Mark it would read?
– Braynner Teixeira
Any Marker, however this is good to test to see if it is getting to that part of the code, so we can check if the error is in ifs, or in outar part
– Shogogan
yes, it is, I will take the ifs and by direct, man thanks!!!!
– Braynner Teixeira
I took out the ifs and it didn’t work either...
– Braynner Teixeira