How to add flags with my intent in the manifest file

Ankit picture Ankit · Jul 11, 2011 · Viewed 18.6k times · Source

we know that there are flags which we can add to our intent using the addFlags() method in our java code. Is there any way we can add these flags in the manifest file itself instead of writing this in java code. I need to add REORDER_TO_FRONT flag for one of my activities in the manifest.

How to achieve this ?

Answer

Vineet Shukla picture Vineet Shukla · Jul 14, 2011

In manifest file you can not add Intent flags.You need to set the flag in Intent which u pass to startActivity. Here is a sample:

Intent intent = new Intent(this, ActivityNameToLaunch.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);