开发者

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

开发者 https://www.devze.com 2022-12-21 18:06 出处:网络
I put a notification in the status bar with a PendingIntent (with Extras 开发者_如何学Goinfo) that points to my main app (main activity). When the user clicks the staus bar, the PendingIntent is fired

I put a notification in the status bar with a PendingIntent (with Extras 开发者_如何学Goinfo) that points to my main app (main activity). When the user clicks the staus bar, the PendingIntent is fired and my app launches and I can read the Extras info in my onCreate() method. So far so good.

But if my app is already running, the PendingIntent simply causes the app to come to the foreground and it does not call any of my methods, so I can't read the content in Extras. What can I do?

Thanks!


It does call a method.

Check out OnNewIntent

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号