0

What happens to an intent if it is broadcast with no registered receivers currently present? Is it waiting in a queue until someone can receive it or is it just gone?

Dale Wilson
  • 9,166
  • 3
  • 34
  • 52
AsafK
  • 2,425
  • 3
  • 32
  • 38

1 Answers1

0

It depends on how you send the broadcast. For example if the code says:

Intent intent = new Intent(AN_ACTION);
sendStickyBroadcast(intent);

The broadcast will be held by the system.

Whenever anyone registers to receive a sticky broadcast they receive the most recent one sent.

If the broadcast is not sticky, then, yes, it disappears if there are no registered receivers.

Dale Wilson
  • 9,166
  • 3
  • 34
  • 52