android notification launches same activity twice

前端 未结 1 1239
Happy的楠姐
Happy的楠姐 2021-01-12 16:46

When I click the notification on the status bar it launches an activity but the behavior is strange. If my app is in foreground and I click the notification the notification

1条回答
  •  旧时难觅i
    2021-01-12 17:15

    _showActivityIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    

    Try this. it will prevent multiple instances of the same activity. u can put this in the manifest also

    0 讨论(0)
提交回复
热议问题