Show activity on this post. When using this flag, if a task is already running for the activity you are now starting, then a new activity will not be started; instead, the current task will simply be brought to the front of the screen with the state it was last in.
The flags you can use to modify the default behavior are: FLAG_ACTIVITY_NEW_TASK. Start the activity in a new task. If a task is already running for the activity you are now starting, that task is brought to the foreground with its last state restored and the activity receives the new intent in onNewIntent() .
FLAG_ACTIVITY_SINGLE_TOP. This is the same as android:launchMode="singleTop" when using it alone. If the activity exists and on the top of the task, it won't create a new instance, instead it will call the top activity's onNewIntent().
In a case like that you can set the FLAG_ACTIVITY_CLEAR_TOP flag for the intent, meaning if the activity being launched is already running in the current task (LoginActivity), then instead of launching a new instance of that activity, all of the other activities on top of it will be closed and this Intent will be ...
So my problem is:
When I press back it brings Sceen2 and Screen1 again. I dont use any other intent flags or launch modes.
Could someone explain what's happening??
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With