Caused by: java.lang.IllegalArgumentException: you must specify a way to create the tab content是什么原因呢???
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
android:layout_width="match_parent"
android:layout_height="338dp"
android:scrollbars="vertical"
android:allowUndo="true" />
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_gravity="center_horizontal|top"
android:orientation="horizontal"
/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
</TabHost>
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTabHost = (TabHost)findViewById(android.R.id.tabhost);
mTabHost.setup();
mTabSpec_1 = mTabHost.newTabSpec("tab1").setIndicator(TAB1, getResources().getDrawable(R.mipmap.ic_launcher));
mTabHost.addTab(mTabSpec_1);
}
}