How to combine Intent flags in Kotlin

后端 未结 3 2043
花落未央
花落未央 2020-12-05 13:02

I want to combine two intent flags as we do bellow in android

Intent intent = new Intent(this, MapsActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEA         


        
3条回答
  •  感动是毒
    2020-12-05 13:20

    Try something like following:

    val intent = Intent(this, MapsActivity::class.java)
    intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
    

提交回复
热议问题