android中的电子邮件应用程序

| 我正在研究android中电子邮件应用程序的新模块。 我的main.xml文件:
<?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个标签(撰写邮件,收件箱,发件箱,草稿和联系人)。在单击相应的选项卡时,我需要显示相应的应用程序。 例如。我单击“撰写邮件”选项卡,我需要撰写邮件应用程序才能显示,然后单击“收件箱”选项卡,我需要显示“收件箱”邮件,依此类推。 某些机构可以帮助我解决这个问题吗? 请给我任何链接,以获取完整的邮箱应用程序源代码。 非常感谢。
已邀请:
Android开发人员网站上的Hello,TabWidget教程将说明您需要执行的关于标签的操作。 每个标签都需要一个“活动”,并且需要设置标签宿主以在它们之间进行切换(在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);

   ...

要回复问题请先登录注册