H
H
HolidayR2018-07-27 18:35:09
Java
HolidayR, 2018-07-27 18:35:09

What is the error in displaying the desired phrase after checking the marker label?

Only one "Strips" message is displayed, both when the marker is clicked with the "Strips" message displayed, and the marker that should display the "Pop" message is displayed. What could be the problem?

public void onMapReady(GoogleMap googleMap) {
    ...
    Tornado = mMap.addMarker(new MarkerOptions()
            .position(HOR));
    Tornado.setTag(Yep);

    Oppy = mMap.addMarker(new MarkerOptions()
            .position(DQE));
    Oppy.setTag(Swe);

    mMap.setOnMarkerClickListener(this);
}

public boolean onMarkerClick(final Marker marker) {
    if (marker.getTag()==Yep) {
        Toast.makeText(getApplicationContext(), "Strips: ",
                Toast.LENGTH_SHORT).show();
    }
    else if (marker.getTag()==Swe) {
        Toast.makeText(getApplicationContext(), "Pop: ",
                Toast.LENGTH_SHORT).show();
    }
    return false;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HolidayR, 2018-07-29
@HolidayR

Is everything correct in the code? Is it worth digging towards fixing the application logic?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question