Android, fragment google maps i viewpager - Błąd nadmuchiwania fragmentu klasy

próbuję użyć google maps v2 w viewpager (fragmentpager) we fragmencie. Działa dobrze, jeśli przeskoczę do czwartego fragmentu (widok pagera), ale jeśli wrócę do pierwszego fragmentu, a następnie z powrotem do czwartego - z mapą - moja aplikacja umrze.

07-04 19:38:20.937: E/AndroidRuntime(20175): FATAL EXCEPTION: main
07-04 19:38:20.937: E/AndroidRuntime(20175): android.view.InflateException: Binary XML     
file line #13: Error inflating class fragment
...
07-04 19:38:20.937: E/AndroidRuntime(20175): Caused by:     
java.lang.IllegalArgumentException: Binary XML file line #13: Duplicate id 0x7f050010,
 tag null, or parent id 0x0 with another fragment for  com.google.android.gms.maps.SupportMapFragment

07-04 19:38:20.937: E/AndroidRuntime(20175):    at     android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:285)
07-04 19:38:20.937: E/AndroidRuntime(20175):    at     android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)

Android Java:

public class LocationDetail extends Fragment {

private SupportMapFragment mMapFragment;
private GoogleMap map;
private EventAdapter listAdapter ;

protected MainActivity activity;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View vw = inflater.inflate(R.layout.map, container, false);

    try {
        MapsInitializer.initialize(getActivity());
    } catch (GooglePlayServicesNotAvailableException e) {
        // TODO handle this situation
    }

    map = ((SupportMapFragment) getFragmentManager().findFragmentById(R.id.map_container)).getMap();
    map.setMyLocationEnabled(true);


    map.addMarker(new MarkerOptions()
    .position(new LatLng(48.397141, 9.98787)).title(" Theatro Club Ulm"));

    map.moveCamera( CameraUpdateFactory.newLatLngZoom(new LatLng(48.397141, 9.98787) , 14.0f) );

    return vw;
}

}

Układ:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:orientation="vertical" >

 <fragment

    android:id="@+id/map_container"
    class="com.google.android.gms.maps.SupportMapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:name="com.dr.diskoapp.MainActivity"
    />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:orientation="vertical" >

<ListView 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/list">          
</ListView>
</LinearLayout>
</LinearLayout>

Widziałem, że istnieje wiele wątków z podobnym problemem, ale nie ma rozwiązania: - /

Upadek może tym razem pomóc.

---------- EDIT ----- Znalazłem rozwiązanie :-)

public void onDestroyView() {
    super.onDestroyView();

    try {
        Fragment fragment = (getFragmentManager().findFragmentById(R.id.map_container));  
        FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
        ft.remove(fragment);
        ft.commit();
    } catch (Exception e) {
        e.printStackTrace();
    }
}

questionAnswers(2)

yourAnswerToTheQuestion