在Android的电子邮件应用程序

问题描述:

我的工作在Android的电子邮件应用程序中的新的模块。

I am working on a new module of Email application in android.

我的main.xml文件:

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>

其工作的罚款。 我的查询是: 我有5个选项卡(撰写邮件,收件箱,草稿,已草稿和联系方式)。在点击相应的标签,我需要显示相应的应用程​​序。 例如。*我点击撰写邮件选项卡上,我需要撰写以获得显示邮件应用,闻我点击收件箱标签我需要显示收件箱中的邮件等。

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?

请参照我要完整的邮箱应用的源$ C ​​$ C的任何链接。

Pls refer me any links for complete mailbox application source code.

由于在advace。

的的您好,TabWidget 补习了对Android开发者网站将解释什么,你需要做的关于你的标签。

The Hello, TabWidget tutorial over on the Android developer site will explain what you need to do regarding your tabs.

您将需要一个活动的每个选项卡,你会设置你的选项卡的主机,像这样在它们之间进行切换(在你的TabActivity):

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):

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

   Resources res = getResources(); // Resource object to get Drawables
   TabHost tabHost = getTabHost();  // The activity TabHost
   TabHost.TabSpec spec;  // Resusable TabSpec for each tab
   Intent intent;  // Reusable Intent for each tab

   // Create an Intent to launch an Activity for the tab (to be reused)
   intent = new Intent().setClass(this, InboxActivity.class);

   // Initialize a TabSpec for each tab and add it to the TabHost
   spec = tabHost.newTabSpec("inbox").setIndicator("Inbox",
                     res.getDrawable(R.drawable.ic_tab_inbox))
                 .setContent(intent);
   tabHost.addTab(spec);

   ...