1

This is the error which i get in my logcat when back to googlemap fragment from other fragments..... i did not understand what to do now....

09-14 12:08:37.638: E/AndroidRuntime(2183): Exception
09-14 12:08:37.648: E/AndroidRuntime(2183): FATAL EXCEPTION: main

09-14 12:08:37.648: E/AndroidRuntime(2183): android.view.InflateException: Binary XML file line #13: Error inflating class fragment
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at com.example.sail.YS_MapFragment.onCreateView(YS_MapFragment.java:91)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.app.Fragment.performCreateView(Fragment.java:1700)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.app.BackStackRecord.run(BackStackRecord.java:684)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.app.FragmentManagerImpl$1.run(FragmentManager.java:443)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.os.Handler.handleCallback(Handler.java:733)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.os.Handler.dispatchMessage(Handler.java:95)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.os.Looper.loop(Looper.java:136)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at android.app.ActivityThread.main(ActivityThread.java:5127)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at java.lang.reflect.Method.invokeNative(Native Method)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at java.lang.reflect.Method.invoke(Method.java:515)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
09-14 12:08:37.648: E/AndroidRuntime(2183):     at dalvik.system.NativeStart.main(Native Method)
09-14 12:08:37.648: E/AndroidRuntime(2183): Caused by: java.lang.IllegalArgumentException: Binary XML file line 

below is my xml code

 <?xml version="1.0" encoding="utf-8"?>
    <com.example.sail.MapWrapperLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/map_relative_layoutNew"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

      <fragment
            android:id="@+id/mapviewNew"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            class="com.google.android.gms.maps.MapFragment" />
    </com.example.sail.MapWrapperLayout>
  • 1
    I have the same issue and I have solved it by creating **dynamic google map** – Pankaj Sep 14 '15 at 06:49
  • You can see my solution [Here](http://stackoverflow.com/a/32004257/2715073) – Pankaj Sep 14 '15 at 06:53
  • possible duplicate of [Error opening SupportMapFragment for second time](http://stackoverflow.com/questions/14565460/error-opening-supportmapfragment-for-second-time) – Pankaj Sep 14 '15 at 06:54
  • thanks for reply but here i am using custom infowindow with two buttons for further navigate to other fragments and since when this functionality i have added, it cause this problem sometime when i navigate go backward. –  Sep 14 '15 at 07:02
  • try dynamically . if map is not showing the issue is not in the xml. try it and replay – Nithinlal Sep 14 '15 at 07:15
  • i have added my xml code please check... Nithinlal –  Sep 14 '15 at 08:01

1 Answers1

0

You can do it programatically and be sure you use getChildFragmentMananger instead of the classic getFragmentManager() to create the fragment.

If you are using below API level 16 then follow below

To use nested fragments on API Level 16 and below, you need to use the fragments backport from the support-v4 or support-v13 portion of the Android Support package. This, in turn, requires you to inherit from FragmentActivity and have your fragments inherit from android.support.v4.app.Fragment. Then, you can call getChildFragmentManager() to use nested fragments.

MPG
  • 785
  • 6
  • 20