I'm a beginner in using fragments. Is it possible to have a layout like this:
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<include layout="@layout/waiting_dialog"/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_layout"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/bg_tile"
android:gravity="center_horizontal"
android:orientation="vertical"
android:visibility="invisible">
<include layout="@layout/no_entries"/>
</LinearLayout>
</merge>
and use it in the fragments' onCreateView like this:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.main, container, false);
return view;
}
There's always the following error:
07-11 09:53:47.608: E/AndroidRuntime(5602): android.view.InflateException: \
<merge /> can be used only with a valid ViewGroup root and attachToRoot=true
How to handle this problem?