Android remove Activity from back stack

后端 未结 11 2084
予麋鹿
予麋鹿 2020-12-07 17:23

Okay so I\'m kind of stumped on what to do with this. So I have the MainActivity, and from there an Activity can be launched to DegreePlanActivity, and from there another Ac

11条回答
  •  忘掉有多难
    2020-12-07 18:01

    simple solution for API >= 15 to API 23 user activity name in intent.

     Intent nextScreen = new Intent(currentActivity.this, MainActivity.class);
     nextScreen.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
     startActivity(nextScreen);
     ActivityCompat.finishAffinity(currentActivity.this);
    

提交回复
热议问题