Skip to content Skip to sidebar Skip to footer

InflateException Caused By Tag Without A Bound Class

I am using the classes and xml layouts of the Master-Detail flow, which is available when creating a new project, to have a list and a detail view side-by-side. However, I am getti

Solution 1:

When I was using the template, I overlooked the fact that the second fragment should actually be a placeholder for a fragment, which in the template was a FrameLayout. My original suspicion turned out to be the issue because a fragment must have a class associated with it. so /res/news_twopane_container.xml should be:

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

    <fragment
        android:id="@+id/news_list_container"
        android:name="com.TrueFalse.news.NewsList"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="1" />
    <!-- NOT fragment, because we don't have data to put here yet -->
    <FrameLayout
        android:id="@+id/news_detail_container"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="1" />

</LinearLayout>

Solution 2:

You might want to try this by replacing onCreate method with onCreateView. I think this might help for you.

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i(LOG_TAG, "Loading Container with news_container.xml");
        setContentView(R.layout.news_list_container);
--------------------------------------------------------------------------

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.news_list_container, container, false);
}

Post a Comment for "InflateException Caused By Tag Without A Bound Class"