i have a timer that runs when an activity starts ..say after 10seconds a notification appears stating that the session will expire in 5 sec . if the user clicks on the notification he is redirected to the last page and the timer is restarted ,if not a new notification appears statinf the session has expired … How to detect if the user has clicked on the notification ???
Share
You should use the Intent in the
Notificationto communicate back to theActivitythat the user has clicked it.When the user selects the notification, Android fires an
Intentthat is defined by theNotification(usually to launch anActivity, but in your case it should be only to send a message). This should be processed in theActivity'sonNewIntent().