Sunday, 15 September 2013

I want that onCreate of my activity will be called every time that my broadcast receiver launches it

I want that onCreate of my activity will be called every time that my
broadcast receiver launches it

I have a broadcast receiver which start an activity on its onReceive with
the following flag :Intent.FLAG_ACTIVITY_NEW_TASK.
Now, the onCreate method of my activity gets called. When I click on the
HOME button, my activity moves back to background but now when the
onReceive function will be called again, the onRestart method will be
called instead of the onCreate.
I want that onCreate will be called on every onReceive (I need the same
behavior for every event that my broadcast receiver received).
Another thing, my activity (the one that gets launched by the broadcast
receiver have this flag in the AndroidManifest.xml file:
android:launchMode="singleInstance".
I done this to prevent a way that clicking on my app icon will launch my
activity (its not the main activity).
Any ideas are more than welcome.
Thanks

No comments:

Post a Comment