|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.content.BroadcastReceiver
android.accounts.AccountMonitor
public class AccountMonitor
A helper class that calls back on the provided AccountMonitorListener with the set of current accounts both when it gets created and whenever the set changes. It does this by binding to the AccountsService and registering to receive the intent broadcast when the set of accounts is changed. The connection to the accounts service is only made when it needs to fetch the current list of accounts (that is, when the AccountMonitor is first created, and when the intent is received).
| Constructor Summary | |
|---|---|
AccountMonitor(Context context,
AccountMonitorListener listener)
Initializes the AccountMonitor and initiates a bind to the AccountsService to get the initial account list. |
|
| Method Summary | |
|---|---|
void |
close()
Unregisters the account receiver. |
protected void |
finalize()
calls close() |
void |
onReceive(Context context,
Intent intent)
This method is called when the BroadcastReceiver is receiving an Intent broadcast. |
void |
onServiceConnected(ComponentName className,
IBinder service)
Called when a connection to the Service has been established, with the IBinder of the communication channel to the
Service. |
void |
onServiceDisconnected(ComponentName className)
Called when a connection to the Service has been lost. |
| Methods inherited from class android.content.BroadcastReceiver |
|---|
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AccountMonitor(Context context,
AccountMonitorListener listener)
context - the context we are running inlistener - the user to notify when the account set changes| Method Detail |
|---|
public void onReceive(Context context,
Intent intent)
BroadcastReceiverIf this BroadcastReceiver was launched through a <receiver> tag,
then the object is no longer alive after returning from this
function. This means you should not perform any operations that
return a result to you asynchronously -- in particular, for interacting
with services, you should use
Context.startService(Intent) instead of
Context.bindService(Intent, ServiceConnection, int).
onReceive in class BroadcastReceivercontext - The Context in which the receiver is running.intent - The Intent being received.
public void onServiceConnected(ComponentName className,
IBinder service)
ServiceConnectionIBinder of the communication channel to the
Service.
onServiceConnected in interface ServiceConnectionclassName - The concrete component name of the service that has
been connected.service - The IBinder of the Service's communication channel,
which you can now make calls on.public void onServiceDisconnected(ComponentName className)
ServiceConnectionServiceConnection.onServiceConnected(android.content.ComponentName, android.os.IBinder) when the Service is next running.
onServiceDisconnected in interface ServiceConnectionclassName - The concrete component name of the service whose
connection has been lost.
protected void finalize()
throws Throwable
finalize in class ObjectThrowablepublic void close()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||