Android Intent Flags Reference

All Android Intent flags (FLAG_ACTIVITY_*, FLAG_RECEIVER_*) with behavior.

Searchable Android Intent flag reference with hex constant value, applicable component type and behaviour notes, plus a combined-int calculator that OR's selected flags.

How do I combine multiple Intent flags?

Bitwise-OR them: intent.setFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK). Each flag is a distinct bit, so OR-ing produces an int carrying all of them. The calculator on this page does the OR for you.

Android Intent flags, decoded

Intent flags fine-tune how Android launches activities, delivers broadcasts and grants temporary access to content URIs. They are bit constants on android.content.Intent, combined with bitwise-OR and passed to setFlags or addFlags. This reference lists the common FLAG_ACTIVITY_*, FLAG_RECEIVER_* and FLAG_GRANT_* flags with their real hex values, the component type each applies to and what behaviour they change — plus a calculator that OR’s your selection into a single int.

How it works

Each flag occupies one bit of a 32-bit int. To apply several, OR them together:

Intent i = new Intent(this, DetailActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(i);

Activity flags control the back stack and task affinity, receiver flags control broadcast delivery and ordering, and grant flags hand a receiver short-lived read or write access to the URIs in the Intent’s data or ClipData. Because the activity and receiver flag sets are read in different contexts, a handful share the same bit value — so only combine flags meant for the same component type.

Tips and notes

  • NEW_TASK is mandatory when starting an activity from a non-Activity context.
  • CLEAR_TOP + SINGLE_TOP is the standard “bring existing screen forward” combo.
  • Grant flags are temporary and revoked when the receiving task finishes.
  • Watch for the shared-bit flags (e.g. 0x40000000) — never mix component types.