Notification with “null” PendingIntent

后端 未结 2 1911
长情又很酷
长情又很酷 2021-02-04 01:44

I\'m trying to implement notification in Android.

Now I have a problem, I don\'t want to have a PendingIntent that user will open any Activity.

2条回答
  •  一整个雨季
    2021-02-04 02:26

    The following works and seems more straightforward:

    PendingIntent pi = PendingIntent.getActivity(context, 0, null, 0);
    

    Having a notification without launching a subsequent Activity seems quite sensible to me - eg "Its time to get up!.

提交回复
热议问题