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);
}
}
これは、どのアクティビティからでも、メニュー ボタンをクリックして、自己紹介ページやヘルプ ページなどに移動できることを意味します。
ただし、これを行うたびに、そのアクティビティの新しいインスタンスを効果的に作成してロードしています。これは、クリックし続けるかのように、開いていた以前のすべてのアクティビティをたどることができます。
これのリソースへの影響はありますか?1 つのアクティビティから離れて移動したアクティビティを終了する方法はありますか?