Multiple Map fragment in action bar tab

时光毁灭记忆、已成空白 提交于 2019-12-12 00:50:48

问题


Basically what i am trying to do is Tab1 -> Organisation Map Fragment Tab2 -> City Map

How should I go about doing this. I tried following some tutorials but it gives me the error "You are allowed to have single MapView in a MapViewActivity". Can some one please help me out


回答1:


It's not possible to do this. As the message says, only one map per Activity.




回答2:


As Joe and the error message says, you can only have one mapview in a single activity.

What you could do (if you still want to use tabs) is just not change the fragment when the tab changes, and instead reload the map with different data.




回答3:


Google released the Map API Version 2. This finally allows to use a MapFragment and a SupportMapFragment. This allows adding Maps to ViewPagers and to Activities that do not extend MapActivity. It should also allow you to have multiple maps in one Activity



来源:https://stackoverflow.com/questions/12569516/multiple-map-fragment-in-action-bar-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!