Starting app only if its not currently running

后端 未结 11 1699
我寻月下人不归
我寻月下人不归 2020-12-02 23:07

I am sending push notification to users which when clicking on it opens the app.

My problem is that when the app is already open, clicking on the notification start

11条回答
  •  借酒劲吻你
    2020-12-02 23:32

    notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP|Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK );

    notificationIntent.putExtras(bundle);
    PendingIntent pintent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
    

提交回复
热议问题