MapView Overlay problem

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

MapView Overlay problem

Postby steven_d » Tue Jan 05, 2010 2:36 pm

Hello,
i develop an app, which tracks gps points and i show these points on my MapView (lets say this is "Activity1"). I can start a second Activity ("Activity2") where i can add some descriptions to the newest gps point. If i close Activity2 and "go back" to Activity1, all my overlays arent display any more. How can i save the overlays??
Must I add all my GPS points to an array an save this array in my onSaveInstanceState() method (because i cant put a List<Overlay> object in the onSaveInstanceState method) and read this array back, if i come back to Activity1 (onStart or onResume??)??

Thanks in advance,
Stefan
steven_d
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jul 20, 2009 1:15 pm
Location: Germany

Top

Postby jp_ksj » Wed Jan 06, 2010 6:10 am

[font=Verdana]

http://www.anddev.org/simple_map_displa ... t9898.html

Please check this and reply me. becoz i could not display even MAP. I think u got MAP in your sample. Thanks in advance.

[/font]
jp_ksj
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Dec 22, 2009 6:39 am

Postby Draffodx » Fri Jan 08, 2010 3:30 pm

you can just re draw them onresume() ?
Draffodx
Master Developer
Master Developer
 
Posts: 205
Joined: Wed Nov 12, 2008 2:31 pm

Postby steven_d » Fri Jan 08, 2010 3:53 pm

Thanks for your answer. Yes, i have now set android:configChanges="keyboardHidden" to my main activity and set the orientation to portrait. in my other activity my orientation is still set to "sensor".
With that logic i dont need to save my instance states (onSaveInstanceState) and if i "come back" to my main activity, i can see all overlays and all instances have their last state. In onResume i set my locationlistener and enable my MyLocationOverlay.

Thanks,
Stefan
steven_d
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jul 20, 2009 1:15 pm
Location: Germany

Postby Droid123 » Tue Jan 12, 2010 12:31 am

or you could save the points in an ItemizedOverlay, that's what I do. Although my app does slow down when it reaches 40+ points
Droid123
Experienced Developer
Experienced Developer
 
Posts: 77
Joined: Sat Nov 21, 2009 1:21 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests