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"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="horizontal" ><fragmentandroid: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 --><FrameLayoutandroid: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.
@OverridepublicvoidonCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(LOG_TAG, "Loading Container with news_container.xml");
setContentView(R.layout.news_list_container);
--------------------------------------------------------------------------
publicViewonCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragmentreturn inflater.inflate(R.layout.news_list_container, container, false);
}
Post a Comment for "Inflateexception Caused By Tag Without A Bound Class"