A
A
AleAleA2018-06-20 00:45:46
Java
AleAleA, 2018-06-20 00:45:46

Catch a click on a specific marker in Google Maps?

Tell me, how can I correctly catch a click on a specific marker on a Google Maps map and then set an action for it? Let's say there are three Marker One variables; two; three; I did this, but it only works from the third or fourth click on the marker:

if (marker.equals(One)) {
        Toast.makeText(getApplicationContext(), "Балалайка: ",
                Toast.LENGTH_SHORT).show();
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2018-06-20
@AleAleA

If I'm not mistaken, the marker has a setTag(Object o) method where you can stuff whatever your heart desires to distinguish them - id, name, any object. Well, accordingly, when you click getTag () and look, they poked where you need to - we do something, no - we do nothing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question