私は2つの下部タブ、タブのクリックでアプリケーションを終了したい
"Exit"と "Back"を設定したアプリケーションを作成しています。
ここでは、「終了」タブ(ボタンではない)をクリックしてアプリケーションを終了します。
私はそれを行うことができます、私はアンドロイドでは、実際にアプリケーションを閉じることはできませんが、私は "終了"をクリックしてホーム画面に移動したいと思います。
私はまた、他のリンク
Is quitting an application frowned upon?
EDITあなたの2番目のタブのクリックで
public class Man_age_ur_PhoneActivity extends TabActivity {
/** Called when the activity is first created. */
ListView listview;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.homepage);
setTabs();
}
private void setTabs()
{
addTab("Exit", R.drawable.tab_exit);
addTab("Back", R.drawable.tab_back);
//To add more tabs just use addTab() method here like previous line.
}
private void addTab(String labelId, int drawableId)
{
TabHost tabHost = getTabHost();
// Intent intent = new Intent(this, c);
TabHost.TabSpec spec = tabHost.newTabSpec("" + labelId);
View tabIndicator = LayoutInflater.from(this).inflate(R.layout.tab_indicator, getTabWidget(), false);
TextView title = (TextView) tabIndicator.findViewById(R.id.title);
title.setText(labelId);
ImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);
icon.setImageResource(drawableId);
spec.setIndicator(tabIndicator);
// spec.setContent(intent);
tabHost.addTab(spec);
}
}
私はあなたがボタンを使うべきではなく、ビューのフリッパー – Nitin
Beenalとタブが、私は、これはあなたが編集した質問を参照してください – Nitin