I created a host tab and I would only put an image on a tab. I found this method:
tabHost.addTab(tabHost.newTabSpec("Tab 1").setContent(R.id.tab1)
.setIndicator("Tab 1",getResources().getDrawable(R.drawable.book)));
that provides text and image, but no good. How should I do?
EDIT
I tried putting in main.xml:
<LinearLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/x2"
android:src="@drawable/book"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
I put in the activity the following statement:
tabHost.addTab(tabHost.newTabSpec("Tab 1").setContent(R.id.tab1));
but the program go crash...