强制刷新 MapView?
我现在有一个大问题,我真的需要一些帮助,我花了一周的时间,但失败了。
- 创建一个 MapActivity (A)
- 从 (A) 启动另一个 Activity (B)
- 从 (B) 启动另一个 MapActivity (C)
- 返回 (C) -> (B)
- 背面 (B) -> (A)
第一个 MapActivity (A) 已经死亡,无论我做什么(放大、缩小、移动)都不会重新绘制。
如何强制 MapActivity (A) 再次工作?
任何帮助将不胜感激,
提前致谢
I've a big problem now, I really need some help, I've spent a week for it, but fail.
- create a MapActivity (A)
- start another Activity (B) from (A)
- start another MapActivity (C) from (B)
- back (C) -> (B)
- back (B) -> (A)
The first MapActivity (A) is death, never be redrawn whatever I do (zoom in, zoom out, move)
How to force MapActivity (A) work again?
Any help would be appreciated,
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你尝试过mapview.invalidate()吗?
did you try mapview.invalidate()?
是的,我也面临这个问题,尝试将 MapView 放在某个布局中,例如 MapLayout。并在onPause()中将MapView从MapLayout中移除,并在onResume()中将MapView添加到MapLayout中。
示例:
相当旧的线程,但我浪费了 3-4 小时来解决这个问题。我希望这个答案对其他人有帮助。
Yes, I too face this issue, try having MapView inside some layout say, MapLayout. And remove MapView from MapLayout in onPause() and add MapView into MapLayout in onResume().
Sample:
Quite old thread but I wasted 3-4 hrs to solve this. I hope this answer will be helpful for others.
没有办法做到这一点
2个MapActivity不能同时存在
只是做其他解决方案,杀死 A 然后回来时创建 A
There is no way to do this
2 MapActivity can not live at the same time
Just do other solution, kill A then create A when come back