Android: How to catch Intent Extras if activity is already running?

I posted a notification in the status bar using PendingIntent (with information about additional features) that points to my main application (main action). When the user clicks on the staus bar, PendingIntent starts up and my application starts up and I can read more information in my onCreate () method. So far, so good.

But if my application is already running, PendingIntent simply forces the application to come to the fore and does not call any of my methods, so I cannot read the contents in Extras. What can I do?

Thanks!

+4
source share
1 answer

He calls the method.

Check out OnNewIntent

+9
source

Source: https://habr.com/ru/post/1303084/


All Articles