Reputation: 370
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
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
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
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