I am trying to refresh the contents of an activity on click of a notification. I can navigate to the activity when I am in some other activity and I click on the notification. What I am trying to achieve is, I am in Activity A which is displaying some content. I get a new notification, I click on it Activity A should either be relaunched or the content in the activity should be refreshed with respect to what I am passing in the PendingIntent of the Notification.
What all I have done,
Tried setting
PendingIntent.FLAG_CANCEL_CURRENT
andPendingIntent.FLAG_UPDATE_CURRENT
Tried setting
Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP
in the intent I am passing along with the pending intent.Checked the data in
onNewIntent()
its doesn't get refreshed. I get the same data which I have passed in the old intent.Passed a unique
requestCode
along with the PendingIntent as well, still the same.
Any Other suggestions?