|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.support.v4.content.LocalBroadcastManager
public class LocalBroadcastManager
Helper to register for and send broadcasts of Intents to local objects
within your process. This is has a number of advantages over sending
global broadcasts with android.content.Context#sendBroadcast
:
Method Summary | |
---|---|
static LocalBroadcastManager |
getInstance(Context context)
|
void |
registerReceiver(BroadcastReceiver receiver,
IntentFilter filter)
Register a receive for any local broadcasts that match the given IntentFilter. |
boolean |
sendBroadcast(Intent intent)
Broadcast the given intent to all interested BroadcastReceivers. |
void |
sendBroadcastSync(Intent intent)
Like sendBroadcast(Intent) , but if there are any receivers for
the Intent this function will block and immediately dispatch them before
returning. |
void |
unregisterReceiver(BroadcastReceiver receiver)
Unregister a previously registered BroadcastReceiver. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static LocalBroadcastManager getInstance(Context context)
public void registerReceiver(BroadcastReceiver receiver, IntentFilter filter)
receiver
- The BroadcastReceiver to handle the broadcast.filter
- Selects the Intent broadcasts to be received.unregisterReceiver(BroadcastReceiver)
public void unregisterReceiver(BroadcastReceiver receiver)
receiver
- The BroadcastReceiver to unregister.registerReceiver(BroadcastReceiver, IntentFilter)
public boolean sendBroadcast(Intent intent)
intent
- The Intent to broadcast; all receivers matching this
Intent will receive the broadcast.registerReceiver(BroadcastReceiver, IntentFilter)
public void sendBroadcastSync(Intent intent)
sendBroadcast(Intent)
, but if there are any receivers for
the Intent this function will block and immediately dispatch them before
returning.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |