Joao Heleno
Joao Heleno

Reputation: 370

Making ItemizedOverlay onTap action trigger without user input to make a balloon visible when changing to screen activity

I have a MapView in my project where I display a set of items with ItemizedOverlay.

When a user taps one of the items a balloon is displayed over it with some info.

Now, what I am trying to achieve is when changing to the map activity screen have a balloon show up without the user tap the screen... like an initialization, where I make a balloon already visible without user input.

Upvotes: 0

Views: 375

Answers (3)

Andres Felipe
Andres Felipe

Reputation: 684

I did it using the following command:

itemizedoverlay.onTap(itemizedoverlay.getItem(0).getPoint(), mapView);

The object itemizedoverlay is an instance of my extension of ItemizedOverlay.

Upvotes: 1

MSquare
MSquare

Reputation: 6469

Maybe you can do this. While you are initially displaying the set of items on ItemizedOverlay, and as you identify the item that should show the balloon, run onTap method for that item's index. If items are already displayed, just identify or retrieve the index for item in question, and run onTap for it.

Upvotes: 1

Dani bISHOP
Dani bISHOP

Reputation: 1289

Have you tried to override onResume for your MapView? It will be called everytime your activity goes to foreground.

Hope it helps!

Upvotes: 0

Related Questions