I have just noticed that parameter FLAG_ACTIVITY_SINGLE_TASK is no more available in the Android developer documentation:
I am just trying to do this:
removeCard.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TASK); startActivity(removeCard);
I have already seen such a parameter in code found in Google but the Java compiler just tells me it does not exist.
I am only able to start the main activity with this parameter but I have to configure the manifest file to perform this:
android:launchMode = "singleTask"
And this does not work for activities other than main activities launched upon app start.
Does someone know why this parameter disappear for Intent ?
Regards, Franz
Ok so after having a look around, I managed to figure out that there is no such things as FLAG_ACTIVITY_SINGLE_TASK or FLAG_ACTIVITY_SINGLE_INSTANCE, nor has there even been. This is because you are looking for values which can only be defined through the application's launch mode which is defined in the manifest. Only FLAG_ACTIVITY_SINGLE_TOP is available as an intent flag. Therefore if you want to make use of any of the singleTask, singleInstance, singleTop or standard launch modes, they must be defined in the manifest:
<activity
android:name="com.company.ActivityName"
android:launchMode="singleTask">
</activity>
See the launchMode section in the documentation: http://developer.android.com/guide/topics/manifest/activity-element.html
android:launchMode = "singleTask"
should work for all activities when used correctly and are you sure you're not referring the FLAG_ACTIVITY_SINGLE_TASK
which is still present and appears to do what you are wanting.
public static final int FLAG_ACTIVITY_SINGLE_TOP
Since: API Level 1 If set, the activity will not be launched if it is already running at the top of the history stack.
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