I am working on a new module of Email application in android.
My main.xml file:
<?xml version="1.0" encoding="utf-8"?>
<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">
<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="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/textview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="@+id/textview2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="@+id/textview3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="@+id/textview4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
<TextView
android:id="@+id/textview5"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="" />
</FrameLayout>
</LinearLayout>
</TabHost>
Its working fine.
My query is:
I have 5 tabs(Compose mail,Inbox,Sentmail,Drafts and Contacts). On clicking the respective tab I need to display corresponding application.
Eg. Wen i click on Compose mail tab, I need to compose mail application to get displayed and wen i click Inbox tab i need to display Inbox mails and so on.
Can some body help me in this issue?
Pls refer me any links for complete mailbox application source code.
Thanks in advace.
The Hello, TabWidget tutorial over on the Android developer site will explain what you need to do regarding your tabs.
You’ll need an Activity for each tab, and you’ll set up your tab host to switch between them like so (in your TabActivity):