Android Intent edit

Broadcasting Messages to Other Components

Intents can be used to broadcast messages to other components of your application (such as a running background service) or to the entire Android system.

To send a broadcast within your application, use the LocalBroadcastManager class:

Intent intent = new Intent("com.example.YOUR_ACTION"); // the intent action
intent.putExtra("key", "value"); // data to be passed with your broadcast

LocalBroadcastManager manager = LocalBroadcastManager.getInstance(context);
manager.sendBroadcast(intent);

To send a broadcast to components outside of your application, use the sendBroadcast() method on a Context object.

Intent intent = new Intent("com.example.YOUR_ACTION"); // the intent action
intent.putExtra("key", "value"); // data to be passed with your broadcast

context.sendBroadcast(intent);

Information about receiving broadcasts can be found here: http://stackoverflow.com/documentation/android/1460/broadcast-receiver#t=201607220748559674078

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Table Of Contents
6 Intent
39 ACRA
64 Menu
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close