Я делаю приложение, в котором я установил две нижние вкладки,
, а именно «Выход» и «Назад».
Теперь я хочу выйти из приложения по нажатию кнопкиВкладка «Выход» (не кнопка).
Как я могу это сделать, я знаю, что в Android мы никогда не сможем закрыть приложение, но я хочу перейти на домашний экран, нажав «Выход».
я изучил следующую ссылку также вместе с другими ссылками
Не одобряется ли выход из приложения?
РЕДАКТИРОВАТЬ
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);
}
}