Error inflating class fragment

后端 未结 30 2673
长发绾君心
长发绾君心 2020-11-22 14:38

I get the Error

Unable to start activity ComponentInfo{de.androidbuch.activiti/de.androidbuch.activiti.task.Activity}: android.view.InflateException: Binar         


        
30条回答
  •  抹茶落季
    2020-11-22 14:42

    I had a similar problem; after running the AdMob example, I tried to insert Ads in my app, causing this error:

    01-02 16:48:51.269    8199-8199/it.dndc.BreathPlot E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.IllegalStateException: Could not execute method of the activity
     Caused by: android.view.InflateException: Binary XML file line #57: Error inflating class fragment
    

    The solution is: you cannot insert the fragment for an Ad into a ListActivity. Instead, I could add it to a FragmentActivity and to an ActionBarActivity without any problem.

    My suggestion is: start from the AdMob example and add into it your existing app: I would have saved a lot of time !!!

提交回复
热议问题