Multiple maps v2 in TabActivity

后端 未结 2 599
终归单人心
终归单人心 2020-12-28 08:42

I\'m currently trying to have 2 maps v2 in different tabs of a TabActivity using MapView objects. The problem arises in the following scenario:

  • tab1 with a map
2条回答
  •  长情又很酷
    2020-12-28 09:34

    We are having the exact same problem. I suspect this is caused by the fact that the new maps uses OpenGL - possibly android cant deal with having two OpenGL widgets in the view hierarchy at the same time even though one is hidden.

    The only way we worked around this was to actually remove the mapview when leaving a tab, then construct a new one and add it back in when going back into the tab. This ensures that there are never two maps constructed at once.

    Nasty, but it worked.

提交回复
热议问题