Pending intent always make new activity

后端 未结 6 2149
耶瑟儿~
耶瑟儿~ 2020-12-20 14:51

i trying to make app with nfc function. the problem is when nfc tag discovered, pending intent always make a new activity that already exist. i\'m using tab host. how to mak

6条回答
  •  一个人的身影
    2020-12-20 15:14

    Create your pending intent as below:

    PendingIntent.getActivity(this, 0,new Intent(this,
        getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP
        |Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT
        |Intent.FLAG_ACTIVITY_REORDER_TO_FRONT), 0);
    

提交回复
热议问题