首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

BroadcastReceiver的运用

2012-07-19 
BroadcastReceiver的使用?BroadCastReceiver 简介?priority :这个是 AndroidManifest.xml 中 intent-filte

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

热点排行