0

I am unable to figure out this issue android.view.InflateException. Here I have 3 tabs which are created by using FragmentPagerAdapter, first two tabs contains general listing and the third is of GoogleMap. It loads properly at first time, here if I navigate back to first tab and come back to second or third tab the application brakes by saying android.view.InflateException: Binary XML file line #8: Error inflating class fragment

I have added the code In Gist, please check the following link Application Code

Community
  • 1
  • 1
Rahul Chandra
  • 483
  • 7
  • 15
  • Are you testing on an emulator or an actual device? – karllindmark Jan 11 '16 at 09:12
  • Post your xml file, which is linked in your `logcat`. – yennsarah Jan 11 '16 at 09:15
  • 1
    Duplicate of [Error opening SupportMapFragment for second time](http://stackoverflow.com/questions/14565460/error-opening-supportmapfragment-for-second-time) question. See this one also: [Duplicate ID, tag null, or parent id with another fragment for com.google.android.gms.maps.MapFragment](http://stackoverflow.com/questions/14083950/duplicate-id-tag-null-or-parent-id-with-another-fragment-for-com-google-androi) – Blo Jan 11 '16 at 09:18
  • @ninetwozero I am using my android device not emulator – Rahul Chandra Jan 11 '16 at 09:35
  • @Fllo the solution worked, Thanks! – Rahul Chandra Jan 11 '16 at 09:46

2 Answers2

0

Maybe there is an incorrect xml element in your layout check line #8 xml code

Edalat Feizi
  • 1,371
  • 20
  • 32
0
@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
    if (view != null) {
      ViewGroup parent = (ViewGroup) view.getParent();
      if (parent != null)
        parent.removeView(view);
    }
    try {
      view = inflater
          .inflate(R.layout.frag_pending_map, container, false);
    } catch (InflateException e) {
      return view;
    }
    return view;
  }
bala
  • 89
  • 1
  • 5