我想注册一个广播接收器接收包事件的广播事件。以下是清单文件中的代码和接收器。日志统计不会发生,但我可以清楚地看到“HomeLoaders”(Launcher)调试语句的相同广播触发。我错过了什么?无法接收广播包的意图
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中? – Zorb 2011-11-24 18:59:47