Clear all activities in a task?

后端 未结 7 1510
有刺的猬
有刺的猬 2020-11-30 01:44

I have a splash screen activity, then a login activity. My history stack looks like:

SplashActivity
LoginActivity

when the user successfull

相关标签:
7条回答
  • 2020-11-30 02:28

    Just do this to clear all previous activity in a task:

    finishAffinity() // if you are in fragment use activity.finishAffinity()
    Intent intent = new Intent(this, DestActivity.class); // with all flags you want
    startActivity(intent)
    
    0 讨论(0)
提交回复
热议问题