Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>No you cannot use <code>android: priority</code> with <code>sendBroadcast</code>. As the docs say:</p> <pre><code>android: priority </code></pre> <p><em>It controls the order in which broadcast receivers are executed to receive broadcast messages. Those with higher priority values are called before those with lower values. (The order <strong>applies only to synchronous messages; it's ignored for asynchronous messages</strong>.) <strong>Use this attribute only if you really need to impose a specific order in which the broadcasts are received, or want to force Android to prefer one activity over others</strong>.</em></p> <p><strong>Now looking at what we know about <code>sendBroadcast</code> which is a <code>Normal broadcast</code></strong>:</p> <p><em>Normal broadcasts (sent with <code>Context.sendBroadcast</code>) are <strong>completely asynchronous (not orderly)</strong>. All receivers of the broadcast are run in an undefined order, often at the same time. This is more efficient, but means that receivers cannot use the result or abort APIs included here.</em></p> <p><strong>For <code>sendOrderedBroadcast</code>, which is an <code>Ordered broadcast</code>:</strong></p> <p><em>Ordered broadcasts (sent with <code>Context.sendOrderedBroadcast</code>) are delivered to one receiver at a time. As each receiver executes in turn, it can propagate a result to the next receiver, or it can completely abort the broadcast so that it won't be passed to other receivers. The order receivers run in can be <strong>controlled with the <code>android:priority</code> attribute</strong> of the matching intent-filter; receivers with the same priority will be run in an arbitrary order.</em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload