android中的电子邮件应用
我正在android上开发一个新的电子邮件应用模块 My main.xml文件:android中的电子邮件应用,android,email,Android,Email,我正在android上开发一个新的电子邮件应用模块 My 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:layou
<?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开发者网站上的教程将解释您需要对选项卡做些什么
您需要为每个选项卡设置一个活动,并将选项卡主机设置为这样在它们之间切换(在TabActivity中):
如果你正在寻找邮件客户端的完整源代码,我建议你要么使用搜索引擎,要么雇佣一名编码员。这种类型的请求在这里是离题的。有人能给我推荐一下android中收件箱和发送邮件的代码吗。我真的在谷歌上搜索了很多。请帮帮我!!
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);
...