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.
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.
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
.
Have you tried to override onResume for your MapView? It will be called everytime your activity goes to foreground.
Hope it helps!
精彩评论