android - OverlayItem looses focus when FragmentActivity Dismiss -
i have mapview overlay items in it. these overlay can tapped show fragmentactivity within mapview. problem when fragmentactivity has been dismissed, mapview returns focus current location. want return focus on tapped overlay item. how can done? answers highly appreciated. thanks
this code have isn't working.
final defaultitemizedoverlay overlay = new defaultitemizedoverlay(trafficprofilemarkeroverlay); final overlayitem overlayitem = new overlayitem(geopoint, "", ""); overlay.additem(overlayitem); overlay.settaplistener(new itemizedoverlay.overlaytaplistener() { @override public void ontap(geopoint pt, mapview mapview) { intent trafficprofileintent = new intent(getapplicationcontext(), trafficprofilepopupactivity.class); startactivity(trafficprofileintent);overlay.setfocus(overlayitem); } }); mapview.getoverlays().add(overlay);
before trafficprofilepopupactivity gets open , can store geopoint in variable.
and when user comes map activity can use cameraupdatefactory.newcameraposition move map camera geopoint stored in variable before in onresume() method.
happy help.
Comments
Post a Comment