I’m displaying a notification via the NotificationManager from a BroadcastReceiver, but if the user touches the notification, nothing happens. If I create notifications from a view, the containing activity is brought to front when touching the notification.
How can I display a specific activity/view or otherwise react to the user touching a notification?
when you receive the broadcast message from the NotificationManager you have to create a new PendingIntent which will be fired when user touch in the proper notification. Now, that PendingIntent must have an inner Intent wich will have an action to perform, like start an activity.
on your “onReceive” method in the BroadcastReceiver call to an auxiliary method, like “showProximityAlertNotification”
if you are executing the newly launched activity and want to cancel the launched notification just do this:
cheers