Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen to use BroadcastReceiver for non-cross-application communication?
    primarykey
    data
    text
    <p>Are there any use cases in which I would want to use a BroadcastReceiver for something other than cross-application communication?</p> <p>After reading the <a href="http://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager.html" rel="nofollow noreferrer">documentation</a>, it seems like they are targeted at cross-application communication, but the idea of using them with the LocalBroadcastManager is also mentioned. I also read <a href="https://stackoverflow.com/questions/5296987/what-is-broadcastreceiver-and-when-we-use-it">this post</a>, which addresses the general usage of broadcast receivers. Neither seem to hit clearly on why it would be useful to use broadcasts and receivers for anything other than cross-application communication. </p> <p>Does it have anything to do with their asynchronous nature, or maybe they're just used to move some processing out of the main activity?</p> <p><strong>Clarification:</strong> I guess the term cross-application was too general. I was considering the built-in actions such as </p> <pre><code>android.hardware.action.NEW_PICTURE </code></pre> <p>to be coming from applications. What I would like to know is: when is it useful to use a BroadcastReceiver for communication within my app - I guess this would narrow it down to custom intent actions/categories. Sorry if the way I'm asking this is confusing. I've only just recently begun programming with Android and I still don't understand the OS very well.</p>
    singulars
    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. 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