如何从谷歌Android的API坚持V2标记? [英] How to persist Marker from Google API Android v2?
问题描述
<一个href=\"https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Marker\">Marker不执行 Parcelable
,序列化
接口,但我需要到活动之间仍然存在它的onPause
/ onResume
,那么,如何能坚持呢?我怎样才能得到所有当前标记列表(找不到getMarkers()方法中的任何地方)?
Marker does not implement Parcelable
, Serializable
interfaces, but i need to persist it between Activity onPause
/onResume
, so how can i persist it? How can i get all current Markers list (can't find getMarkers() method anywhere)?
畅想下一个案例:我已经添加了标记
开始的AsyncTask
来执行长时间运行的任务和更新视图为标记。任务正在进行中,我改变方向,活性重建。我怎么能任务完成后更新标记?让我们想象一下,我可以坚持的标记的ID和标记由片段自动保存的(想象),然后使用ID它活动后重建?我怎样才能找到
Imagine the next case: i have added Marker
and started AsyncTask
to perform long-running task and update view for the Marker. Task is in progress and i change orientation, activity is recreated. How can i update that Marker after Task is finished? Let's imagine i can persist id of the Marker and Markers are saved by fragment automatically (just imagine), then how can i find it using id after activity is recreated?
推荐答案
似乎也没有办法,现在做到这一点:的 HTTP://$c$c.google.com/p/gmaps-api-issues/issues/detail ID = 4650
it seems that there is no way to do this now: http://code.google.com/p/gmaps-api-issues/issues/detail?id=4650
这篇关于如何从谷歌Android的API坚持V2标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!