【发布时间】:2009-10-20 07:41:50
【问题描述】:
我正在尝试注册一个广播接收器来接收包事件的广播事件。以下是清单文件中的代码和我的接收器。日志语句永远不会发生,但我可以清楚地看到“HomeLoaders”(启动器)调试语句的相同广播触发。我错过了什么?
public class IntentListener extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Log.i("INTENT LISTNER:", intent.getAction());
}
}
<receiver android:name="IntentListener" android:enabled="true" android:exported="true">
<intent-filter>
<data android:scheme="package"></data>
<action android:name="android.intent.action.PACKAGE_ADDED"></action>
<action android:name="android.intent.action.PACKAGE_ADDED"></action>
<action android:name="android.intent.action.PACKAGE_CHANGED"></action>
</intent-filter>
</receiver>
【问题讨论】:
-
错误可能在 IntentListener 而不是 com.android.samples.app.IntentListener ?
标签: android