在我的應用程序中,我不想在導航抽屜菜單上單擊相同活動時的活動。如何防止導航抽屜菜單單擊時的重新創建活動
用戶在導航抽屜項目點擊地圖重新加載後的地圖活動。我不想重新加載地圖或刷新活動。
private void displayView(int position)
{
switch (position)
{
case 0:
break;
case 1:
Intent intent1 = new Intent(this, Activity1.class);
startActivity(intent1);
//finish();
break;
case 2:
Intent intent2 = new Intent(this, Activity2.class);
startActivity(intent2);
finish();
break;
case 3:
Intent intent4 = new Intent(this, Activity3.class);
startActivity(intent4);
finish();
break;
default:
break;
}
1)請出示你的代碼。 2)菜單應該是裝載片段,無法啓動活動 –
在我的代碼,我使用的活動不片斷 –
好吧,請[編輯]你的問題,包括代碼 –