Pierrew
Pierrew

Reputation: 482

Notification intent to recreate Activity

I am currently in Activity A. I receive notifications and I want to recreate the Activity A when I click on the notification (finish A and then create A again). Intent class doesn't seem to have a flag similar to PendingIntent.FLAG_CANCEL_CURRENT.

Upvotes: 0

Views: 209

Answers (1)

Pierrew
Pierrew

Reputation: 482

I basically solved this by using onNewIntent()

For single top activity, when you click on the notification, onNewIntent will be called and you can call recreate() there.

Upvotes: 1

Related Questions