Android:BroadcastReceiver
2010-10-19 20:16:47 来源:WEB开发网The Intent filters used in registerReceiver(BroadcastReceiver, IntentFilter) and in application manifests are not guaranteed to be exclusive. They are hints to the operating system about how to find suitable recipients. It is possible for senders to force delivery to specific recipients, bypassing filter resolution. For this reason, onReceive() implementations should respond only to known actions, ignoring any unexpected Intents that they may receive.
Parameters
context The Context in which the receiver is running.
intent The Intent being received.
onReceive()函数当BroadcastReceiver收到新的Intent时才会执行。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public final void setResult (int code, String data, Bundle extras)
Since: API Level 1
Change all of the result data returned from this broadcasts; only works with broadcasts sent through Context.sendOrderedBroadcast. All current result data is replaced by the value given to this method.
This method does not work with non-ordered broadcasts such as those sent with Context.sendBroadcast
Parameters
code The new result code. Often uses the Activity RESULT_CANCELED and RESULT_OK constants, though the actual meaning of this value is ultimately up to the broadcaster.
data The new result data. This is an arbitrary string whose interpretation is up to the broadcaster; may be null.
extras The new extra data map. This is a Bundle holding arbitrary data, whose interpretation is up to the broadcaster. Can be set to null. This
Tags:Android BroadcastReceiver
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接