我的所有 4 项活动都有以下菜单
@Override
public boolean onOptionsItemSelected(android.view.MenuItem item)
{
// Handle item selection
switch (item.getItemId())
{
case R.id.aboutme:
android.content.Intent i = new android.content.Intent(this, About.class);
startActivity(i);
return true;
case R.id.help:
// showHelp();
return true;
case R.id.languageselection:
android.content.Intent i2 = new android.content.Intent(this, com.jameselsey.LanguageSelection.class);
startActivity(i2);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
这意味着从我的任何活动中,我都可以点击菜单按钮并转到“关于我”页面或“帮助”页面等。
但是,每次我这样做时,我都会有效地创建该活动的一个新实例并加载它,就好像我一直单击返回一样,我会回溯我之前打开的所有活动。
这对资源有什么影响吗?有什么方法可以让我离开一项活动并杀死我已经离开的活动?