1
我已經嘗試了新的谷歌地圖API V2谷歌地圖API第2多地圖碎片問題
我已經是一個包裝了mapFragment片段,這是在應用程序的創建乞討幾個問題。
在用戶點擊一個按鈕時創建的另一個片段,這個內容另一個mapFragment。
但是,此地圖顯示了第一個片段上顯示的第一個地圖。它也被凍結,無法對其執行操作...
我讀過一些用戶有問題要顯示multimaps。任何想法如何解決這個問題?
這是我創建的地圖:
mMapFragment = (SupportMapFragment) this.getActivity().getSupportFragmentManager()
.findFragmentByTag(MAP_FRAGMENT_TAG);
// We only create a fragment if it doesn't already exist.
if (mMapFragment == null) {
// To programmatically add the map, we first create a
// SupportMapFragment.
mMapFragment = SupportMapFragment.newInstance();
mMapFragment.setRetainInstance(false);
// Then we add it using a FragmentTransaction.
FragmentTransaction fragmentTransaction = this.getActivity().getSupportFragmentManager()
.beginTransaction();
fragmentTransaction.add(R.id.ly_map, mMapFragment,MAP_FRAGMENT_TAG);
fragmentTransaction.commit();
} else {
dbug.log("Restoring map");
mMapFragment.setRetainInstance(false);
mMap = mMapFragment.getMap();
}
// We can't be guaranteed that the map is available because Google Play
// services might
// not be available.
setUpMapIfNeeded();
我想嘗試新的嵌套片段,因爲也許可以使它工作。 – Marcel 2013-05-07 07:03:43