Binary XML file line #9: Error inflating class fragment

点点圈 提交于 2019-12-01 03:24:36

Your activity CheckList should extend FragmentActivity .

<fragment class="com.uday.honeytest.CheckList$Description" is where it's getting the error.

Are you sure you have the fully qualified class name typed correctly?

Have you tried cleaning your project/fixing project properties?

I don't see anything named Description in that class, that may be the issue.

Hope this helps.

I just removed onCreateView code which contains inflating xml in listview fragmentand move into onActivityCreated method with that its working.

The reason may be:

ListFragment has a default layout that consists of a single list view. However, if you desire, you can customize the fragment layout by returning your own view hierarchy from onCreateView(LayoutInflater, ViewGroup, Bundle). To do this, your view hierarchy must contain a ListView object with the id "@android:id/list" (or list if it's in code)

So my listview extends ListFragment and not conatining list in xml , and directly we can setListAdapter in onActivityCreated rather than in onCreateView.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!