Skip to content Skip to sidebar Skip to footer

Get The Intent That Woke Up My Activity

I'm developing an application that includes a broadcast receiver. The broadcast receiver sets a notification onReceive(), which includes a pending Intent Intent updateHistoryInten

Solution 1:

when the activity was sleeping

Activities don't sleep. I am assuming that you mean that the activity was in the background.

How can I get the Intent that woke up my activity?

Add FLAG_ACTIVITY_CLEAR_TOP|FLAG_ACTIVITY_SINGLE_TOP as flags to your Intent. Then, your activity will get this Intent passed to it via onNewIntent().

Solution 2:

I think the problem is that when an activity is woken, getIntent() returns the intent that first started it.

Post a Comment for "Get The Intent That Woke Up My Activity"