Android: Intent Flag to destroy activity and start new one

前端 未结 2 1426
耶瑟儿~
耶瑟儿~ 2021-02-07 00:55

So I have a Login Activity This Activity inflates a login.xml layout which has a USER_NAME and PASSWORD EditText Views, when I enter the Username and Password and click the Logi

2条回答
  •  孤城傲影
    2021-02-07 01:48

    If you are supporting only API levels 11+, you should be able to use FLAG_ACTIVITY_CLEAR_TASK. This will finish all existing Activities in all tasks and create a new instance of the Login activity.

提交回复
热议问题