1.Your content must has a tabhost whose id attribute is ' Android. R.id.tabhost ' resolution
Android:id= "@android: Id/tabhost"
Attention is @android:id, not usually written @id
2.Attempt to invoke virtual method ' Boolean android.view.View.requestFocus () ' On a null object reference
<tabwidget android:id= "@android: Id/tabs" android:layout_width= "match_parent" android:layout_ height= "Wrap_content" >
No write at the end
/
Tabhost contains two controls: Tabwidget and Framelayout are parallel independent relationships, not included, because they are beginner, so not clear.
<span style= "Font-family:times New roman;font-size:14px;" ><tabhost xmlns:android= "http://schemas.android.com/apk/res/android" android:layout_width= "Fill_parent" android:layout_height= "Fill_parent" android:id= "@android: Id/tabhost" > <linearlayout android:orientation= " Vertical "android:layout_width=" fill_parent "android:layout_height=" fill_parent "> <span style=" Background-color:rgb (51, 204, 255); " > <tabwidget android:id= "@android: Id/tabs" android:layout_width= "Match_parent" Android oid:layout_height= "Wrap_content"/></span> <span style= "Background-color:rgb (51, 204, 0);" > <FrameLayout</span> android:layout_width= "match_parent" android:layout_height= "Match_parent" android:id= "@android: Id/tabcontent" > <!--define the contents of the first tab-- <linearlayout android:id= "@+id/tab01" android:orientation= "vertical" android:layout_wiDth= "Fill_parent" android:layout_height= "Fill_parent" > <!--define two TextView to display the contents of the tab page-- <textview android:layout_width= "fill_parent" android:layout_height= "wrap_content" android:text= "Monkey King-2011/0 7/12 "/> <textview android:layout_width=" fill_parent "android:layout_height=" Wrap_content "Android : text= "Pig -2011/07/10"/> </LinearLayout> <!--define the contents of the second tab-- <linearlayout android:id= "@+id/tab02" android:orientation= "vertical" android:layout_width= "Fill_parent" Android : layout_height= "Fill_parent" > <textview android:layout_width= "fill_parent" android:layout_height= "Wrap_content" android:text= "sa monk -2011/07/11"/> <textview android:layout_width= "Fill_parent" Androi d:layout_height= "Wrap_content" android:text= "Tang priest -2011/07/10"/> </LinearLayout> <! --Define the contents of the Third tab-- <linearlayout android:id= "@+id/tab03" android:orientation= "vertical" android:layout_width= "Fill_parent" Android : layout_height= "Fill_parent" > <textview android:layout_width= "fill_parent" android:layout_height= "Wrap_content" android:text= "Monkey King -2011/07/12"/> <textview android:layout_width= "Fill_parent" Andro id:layout_height= "wrap_content" android:text= "sa monk -2011/07/08"/> </LinearLayout> <span Style= "Background-color:rgb (51, 204, 0); > </FrameLayout></span> </LinearLayout></span>
Tabhost related Error