Mando
Mando

Reputation: 11722

Is it possible to apply CLEAR_TOP flag for activity in manifest?

I want to have an activity which clears top (clearTop=true) whenever there is an intent to start that activity. Right now I have to control the activity start from every place and manually add (xamarin.android syntax) activity flag to intent:

intent.AddFlags(ActivityFlags.ClearTop);

Please advise how to put this behavior into manifest/attribute

Upvotes: 3

Views: 1293

Answers (2)

Eric
Eric

Reputation: 17566

I tested the different launchModes, and I found that singleTask seems to act exactly like singleTop + FLAG_ACTIVITY_CLEAR_TOP.

android:launchMode="singleTask"

Upvotes: 0

Andrii Bas
Andrii Bas

Reputation: 623

Put attribute android:launchMode="singleTop" to your activity

more info here

Upvotes: 0

Related Questions