【发布时间】:2015-01-27 01:50:53
【问题描述】:
我有一个应用程序,它根据连接状态使用 googlemaps 或 openMaps(离线)。
在每种情况下都有标记,用于地点或兴趣点或……我希望用户可以显示或隐藏某些类别的标记。
When using google maps I have a menu and in the action bar when some item is selected it toggles between showing or hiding the markers from the correpondent category;至于使用isVisible(); 可以轻松完美地工作的谷歌地图
至于 osmdroid,我在文档中没有找到任何与 isVisible() 等效的东西,也没有找到任何 show() 或 hide() 方法。所以我尝试使用somemarkers.getAlpha() 和somemarkers.setAlpha() 作为解决方法,在0 和1 alpha 值之间切换。
没有发生错误,但标记的可见性保持不变,不切换,或者仅当我在操作图标上点击 10 或 20 次时随机。
在日志中我得到"InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed",在我看来这就是原因。
但是如何避免这种情况呢?
奇巧、索尼Xperia Z
【问题讨论】: