Android: open activity without save into the stack

前端 未结 10 1917
暗喜
暗喜 2020-11-27 04:19

I have 2 activities: Main and List.

From Main you can open List; from List you can open Main.

I\'d like it so that every opening of List does not

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 05:00

    Just wanted to add a way to do this in Kotlin:

    val i = Intent(this, LogInActivity::class.java)
    startActivity(i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK))
    

提交回复
热议问题