NotificationManager.cancel(id) is not working inside a broadcast receiver

后端 未结 6 927
温柔的废话
温柔的废话 2020-12-16 00:49

Android: I am trying to cancel a notification from the notification bar after a package being installed. What I am doing is the following:

 public class MyBr         


        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-16 01:19

    Sorry for late joining! But following worked fine for me.

    NotificationManagerCompat mNotificationManager = NotificationManagerCompat.from(context.getApplicationContext());
    mNotificationManager.cancel("",);
    

提交回复
热议问题