Skip to content Skip to sidebar Skip to footer

How To Reuse Intents In Android

Hello All: I am creating an application in which I am using menus on every screen for the user to navigate. In my application, I have Screen1--> comes as home screen when the us

Solution 1:

Ashwani,

I believe this can be done with a setFlags() call on your Intent using the FLAG_ACTIVITY_REORDER_TO_FRONT flag. If screen 1 still exists it will bring it to the foreground. The documentation doesn't seem to specify, but I assume it launches a new Activity of Screen 1 was killed.

Solution 2:

Take a look at android:launchMode attribute of element. Is "singleTop" launch mode is what you mean by "use existing home screen"? If you use "singleTop" the activity is not recreated, but receives onNewIntent() signal.

Post a Comment for "How To Reuse Intents In Android"