Tôi đang cố gắng đăng ký Bộ thu phát sóng để nhận các sự kiện phát sóng cho các sự kiện trọn gói. Sau đây là mã và người nhận của tôi trong tệp kê khai. Các bản ghi nhật ký không bao giờ xảy ra, nhưng tôi rõ ràng có thể nhìn thấy cùng một phát sóng bắn cho "HomeLoaders" (Launcher) các báo cáo gỡ lỗi. Tôi đang thiếu gì?Không thể nhận chương trình phát sóng cho mục đích PACKAGE
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>
lỗi có thể nằm trong IntentListener thay vì com.android.samples.app.IntentListener? – Zorb