Starting from android 12 , starting activity from BroadcastReceiver and services is not possible anymore, according to the documentation this is called Notification trampoline restrictions and now we should use pendingintent that take us directly to the activity concerned, the issue here is that i am used to dismiss the notification in the broadcastreceiver
private class NotificationBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
final int NOTIFICATION_ID = intent.getIntExtra("notificationId",0);
Log.v("NOTIFICATION_ID",Integer.toString(NOTIFICATION_ID));
mNotificationManager.cancel(NOTIFICATION_ID);
but now i don't have where to cancel notification without the broadcastReceiver....after clicing the actionButton that added to my notificationBuilder, the notification is not dismissed and still going , anyway to manage that ?