我有Activity
一个简单的布局。
活动:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.my_layout);
布局:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.my.layout
android:id="@+id/my_id"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</com.my.layout>
</FrameLayout>
我想FrameLayout
用合并标签替换,但结果我在期间收到以下错误setContentView
:
01-25 17:08:24.660: E/AndroidRuntime(25837):
java.lang.RuntimeException: Unable to start activity ComponentInfo{my.app/my.app.MyActivity}:
android.view.InflateException: <merge /> can be used only with a valid ViewGroup root and attachToRoot=true