读书人

BroadcastReceiver的运用

发布时间: 2012-07-19 16:02:20 作者: rapoo

BroadcastReceiver的使用

?

BroadCastReceiver 简介

?

priority :这个是 AndroidManifest.xml intent-filter 的参数。

?

? initialCode, initialData, initialExtras)

上面这个方法发送时,得到的是 true;

判断是否是有序广播;

?

?

onReceive (Context context, Intent intent)

?

public IBinder peekService (Context myContext, Intent service)

Provide a binder to an already-running service. This method is synchronous and will not start the target service if it is not present, so it is safe to call from onReceive.

?

Parameters:

myContext The Context that had been passed to onReceive(Context, Intent)

service The Intent indicating the service you wish to use. See Context.startService(Intent) for more information.

setDebugUnregister (boolean debug)

Control inclusion of debugging help for mismatched calls to {@ Context#registerReceiver(BroadcastReceiver, IntentFilter) Context.registerReceiver()}. If called with true, before given to registerReceiver(), then the callstack of the following Context.unregisterReceiver() call is retained, to be printed if a later incorrect unregister call is made. Note that doing this requires retaining information about the BroadcastReceiver for

?

本文摘自:http://dl.iteye.com/topics/download/85cb1335-95e2-36af-84da-86ba6b18384e

读书人网 >移动开发

热点推荐