Android remove Activity from back stack

后端 未结 11 2054
予麋鹿
予麋鹿 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条回答
  •  Happy的楠姐
    2020-12-07 17:59

    This code should help you out: It is in Kotlin
    private fun verifyIfUserIsLoggedIn(){
            val uid = FirebaseAuth.getInstance().uid
            if(uid== null){
                val intent = Intent(this, MainActivity::class.java)
                intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK.or(Intent.FLAG_ACTIVITY_NEW_TASK)
                startActivity(intent)
            }
        }
    

提交回复
热议问题