Android creates new activity from above, despite "singleTop"

I have an action with

    android:launchMode="singleTop"

How can I manipulate intent to create a new Activity on Top. The reason is in the exceptional case I need a new activity.

Or is it impossible?

+3
source share
1 answer

I would remove the flag singleTopin the manifest and instead add it as a flag for my own purposes, where you need them, using:

intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);

Then in the case when you do not need to use singleTop, do not set this flag.

0
source

All Articles