NotificationManager.cancel(id) is not working inside a broadcast receiver
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 MyBroadcastReceiver extends BroadcastReceiver { private static final String TAG = "MyBroadcastReceiver"; @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (Intent.ACTION_PACKAGE_ADDED.equals(action)) { Uri data = intent.getData(); //some code goes here //get the id of the notification to cancel in some way notificationhelper._completeNotificationManager.cancel(id); } } } where public class