Android Google map v2 in tab Overlapping issue, Multiple map in tab

前端 未结 3 1797
醉话见心
醉话见心 2021-01-13 17:15

I am new to android, now am working with Google maps v2, I have used tabhost to show Google map v2, In this tabhost i need to show two Google maps v2 on different tab. When

3条回答
  •  再見小時候
    2021-01-13 17:58

    I had the same problem (google maps v2 showed only a grey grid in a tab, but if I load it as a main activity without tabs than it works).

    Then I added mMapFragment.onResume() and now it works in a tab! Try this:

    mMapFragment = ((MapFragment) getFragmentManager().findFragmentById(R.id.map));
    mMapFragment.onResume(); // needed to get the map to display immediately
    

    I've found the solution here: https://stackoverflow.com/a/16960527/185493

提交回复
热议问题