Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Theo giới hạn về thực thi ở chế độ nền của Android 8.0 (API cấp 26), ứng dụng nhắm đến API cấp 26 trở lên không thể đăng ký broadcast receiver cho thông báo truyền phát ngầm ẩn trong tệp kê khai, trừ phi thông báo truyền tin được gửi riêng cho các ứng dụng đó.
Tuy nhiên, một số thông báo truyền phát được miễn khỏi những giới hạn này. Các ứng dụng có thể tiếp tục đăng ký trình nghe cho các thông báo sau, bất kể ứng dụng nhắm đến cấp độ API nào.
Được miễn trừ vì những thông báo này chỉ được gửi một lần, trong lần khởi động đầu tiên và nhiều ứng dụng cần nhận những thông báo này, chẳng hạn như để lên lịch cho công việc và chuông báo.
Một số ứng dụng cần biết về các thay đổi đối với tài khoản đăng nhập để có thể thiết lập các hoạt động theo lịch cho các tài khoản mới và tài khoản đã thay đổi.
Các ứng dụng có quyền hiển thị trong một tài khoản sẽ nhận được thông báo này khi tài khoản đó bị xoá. Nếu đây là thay đổi tài khoản duy nhất mà ứng dụng cần thực hiện, thì ứng dụng nên sử dụng thông báo truyền tin này thay vì LOGIN_ACCOUNTS_CHANGED_ACTION không dùng nữa.
Chỉ được gửi khi người dùng xoá dữ liệu của họ khỏi phần Cài đặt một cách rõ ràng, do đó, broadcast receiver ít có khả năng ảnh hưởng đáng kể đến trải nghiệm người dùng.
Một số ứng dụng cần cập nhật dữ liệu đã lưu trữ khi xoá một gói khác. Đối với những ứng dụng đó, không có cách nào khác là đăng ký thông báo truyền tin này.
Lưu ý: Các thông báo truyền tin khác liên quan đến gói (chẳng hạn như ACTION_PACKAGE_REPLACED) không được miễn trừ khỏi các hạn chế thực thi trong nền. Những thông báo này phổ biến đến mức có thể có tác động tiềm ẩn về hiệu suất để miễn trừ các thông báo đó.
Do nhà cung cấp lịch gửi để đăng lời nhắc sự kiện lên ứng dụng lịch. Vì nhà cung cấp lịch không biết ứng dụng lịch là gì nên thông báo truyền tin này phải được ngầm ẩn.
Những thông báo này được gửi do các tương tác vật lý của người dùng với thiết bị, chẳng hạn như cài đặt hoặc xoá phương tiện bộ nhớ hoặc trong quá trình khởi động, khi các phương tiện có sẵn được gắn kết. Đây không phải là những trường hợp xảy ra phổ biến và thường thuộc quyền kiểm soát của người dùng.
Các ứng dụng nhận tin nhắn SMS phụ thuộc vào những thông báo này.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Implicit broadcast exceptions\n\nAs part of the Android 8.0 (API level 26) [background execution\nlimits](/about/versions/oreo/background#broadcasts), apps that target the\nAPI level 26 or higher can't register broadcast receivers for implicit\nbroadcasts in their manifest unless the broadcast is sent specifically to them.\nHowever, several broadcasts are exempted from these limitations. Apps can\ncontinue to register listeners for the following broadcasts, no matter what API\nlevel the apps target.\n| **Note:** Even though these implicit broadcasts still work in the background, avoid registering listeners for them.\n\n[ACTION_LOCKED_BOOT_COMPLETED](/reference/android/content/Intent#ACTION_LOCKED_BOOT_COMPLETED), [ACTION_BOOT_COMPLETED](/reference/android/content/Intent#ACTION_BOOT_COMPLETED)\n: Exempted because these broadcasts are sent only once, at first boot,\n and many apps need to receive these broadcasts, such as to schedule jobs and alarms.\n\n[ACTION_USER_INITIALIZE](/reference/android/content/Intent#ACTION_USER_INITIALIZE), `android.intent.action.USER_ADDED`, `android.intent.action.USER_REMOVED`\n: Privileged permissions protect these broadcasts, so most normal\n apps can't receive them anyway.\n\n`android.intent.action.TIME_SET`, [ACTION_TIMEZONE_CHANGED](/reference/android/content/Intent#ACTION_TIMEZONE_CHANGED), [ACTION_NEXT_ALARM_CLOCK_CHANGED](/reference/android/app/AlarmManager#ACTION_NEXT_ALARM_CLOCK_CHANGED)\n: Clock apps might need to receive these broadcasts to update alarms when the\n time, timezone, or alarms change.\n\n[ACTION_LOCALE_CHANGED](/reference/android/content/Intent#ACTION_LOCALE_CHANGED)\n: Only sent when the locale changes, which is not often. Apps might need to\n update their data when the locale changes.\n\n[ACTION_USB_ACCESSORY_ATTACHED](/reference/android/hardware/usb/UsbManager#ACTION_USB_ACCESSORY_ATTACHED), [ACTION_USB_ACCESSORY_DETACHED](/reference/android/hardware/usb/UsbManager#ACTION_USB_ACCESSORY_DETACHED), [ACTION_USB_DEVICE_ATTACHED](/reference/android/hardware/usb/UsbManager#ACTION_USB_DEVICE_ATTACHED), [ACTION_USB_DEVICE_DETACHED](/reference/android/hardware/usb/UsbManager#ACTION_USB_DEVICE_DETACHED)\n: When an app needs to know about these USB-related events, there is no\n good alternative to registering for the broadcast.\n\n[BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED](/reference/android/bluetooth/BluetoothHeadset#ACTION_CONNECTION_STATE_CHANGED), [BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED](/reference/android/bluetooth/BluetoothA2dp#ACTION_CONNECTION_STATE_CHANGED), [ACTION_ACL_CONNECTED](/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_CONNECTED), [ACTION_ACL_DISCONNECTED](/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_DISCONNECTED)\n: User experience is not likely to suffer if apps receive broadcasts for these\n Bluetooth events.\n\n[ACTION_CARRIER_CONFIG_CHANGED](/reference/android/telephony/CarrierConfigManager#ACTION_CARRIER_CONFIG_CHANGED), `TelephonyIntents.ACTION_*_SUBSCRIPTION_CHANGED`, `TelephonyIntents.SECRET_CODE_ACTION`, [ACTION_PHONE_STATE_CHANGED](/reference/android/telephony/TelephonyManager#ACTION_PHONE_STATE_CHANGED), [ACTION_PHONE_ACCOUNT_REGISTERED](/reference/android/telecom/TelecomManager#ACTION_PHONE_ACCOUNT_REGISTERED), [ACTION_PHONE_ACCOUNT_UNREGISTERED](/reference/android/telecom/TelecomManager#ACTION_PHONE_ACCOUNT_UNREGISTERED)\n: OEM telephony apps might need to receive these broadcasts.\n\n[LOGIN_ACCOUNTS_CHANGED_ACTION](/reference/android/accounts/AccountManager#LOGIN_ACCOUNTS_CHANGED_ACTION)\n: Some apps need to know about changes to login accounts so they can set up\n scheduled operations for the new and changed accounts.\n\n[ACTION_ACCOUNT_REMOVED](/reference/android/accounts/AccountManager#ACTION_ACCOUNT_REMOVED)\n: Apps that have visibility into an account receive this broadcast when the\n account is removed. If this is the only account change that the app needs\n to act on, we recommend that the app use this broadcast\n instead of the deprecated\n [LOGIN_ACCOUNTS_CHANGED_ACTION](/reference/android/accounts/AccountManager#LOGIN_ACCOUNTS_CHANGED_ACTION).\n\n[ACTION_PACKAGE_DATA_CLEARED](/reference/android/content/Intent#ACTION_PACKAGE_DATA_CLEARED)\n: Only sent when the user explicitly clears their data from Settings,\n so broadcast receivers are unlikely to significantly affect user experience.\n\n[ACTION_PACKAGE_FULLY_REMOVED](/reference/android/content/Intent#ACTION_PACKAGE_FULLY_REMOVED)\n\n: Some apps need to update their stored data when another package is\n removed. For those apps, there is no good alternative to registering for this\n broadcast.\n\n **Note:** Other package-related broadcasts (such as [ACTION_PACKAGE_REPLACED](/reference/android/content/Intent#ACTION_PACKAGE_REPLACED)) are *not* exempted from\n the background execution restrictions. These broadcasts are common enough that there is a\n potential performance impact to exempting them.\n\n[ACTION_NEW_OUTGOING_CALL](/reference/android/content/Intent#ACTION_NEW_OUTGOING_CALL)\n\n: Apps that take action in response to users placing calls need to receive this\n broadcast.\n\n[ACTION_DEVICE_OWNER_CHANGED](/reference/android/app/admin/DevicePolicyManager#ACTION_DEVICE_OWNER_CHANGED)\n\n: This broadcast is not sent very often. Some apps need to receive it, so that\n they know that the device's security status changed.\n\n[ACTION_EVENT_REMINDER](/reference/android/provider/CalendarContract#ACTION_EVENT_REMINDER)\n\n: Sent by the [calendar\n provider](/guide/topics/providers/calendar-provider) to post an event\n reminder to the calendar app. Since the calendar provider doesn't know what\n the calendar app is, this broadcast must be implicit.\n\n[ACTION_MEDIA_MOUNTED](/reference/android/content/Intent#ACTION_MEDIA_MOUNTED), [ACTION_MEDIA_CHECKING](/reference/android/content/Intent#ACTION_MEDIA_CHECKING), [ACTION_MEDIA_UNMOUNTED](/reference/android/content/Intent#ACTION_MEDIA_UNMOUNTED), [ACTION_MEDIA_EJECT](/reference/android/content/Intent#ACTION_MEDIA_EJECT), [ACTION_MEDIA_UNMOUNTABLE](/reference/android/content/Intent#ACTION_MEDIA_UNMOUNTABLE), [ACTION_MEDIA_REMOVED](/reference/android/content/Intent#ACTION_MEDIA_REMOVED), [ACTION_MEDIA_BAD_REMOVAL](/reference/android/content/Intent#ACTION_MEDIA_BAD_REMOVAL)\n\n: These broadcasts are sent as a result of the user's physical interactions with\n the device, like installing or removing storage volumes, or as part of\n boot initialization, as available volumes get mounted. They aren't a common\n occurrence, and are usually under the user's control.\n\n[SMS_RECEIVED_ACTION](/reference/android/provider/Telephony.Sms.Intents#SMS_RECEIVED_ACTION), [WAP_PUSH_RECEIVED_ACTION](/reference/android/provider/Telephony.Sms.Intents#WAP_PUSH_RECEIVED_ACTION)\n\n: SMS recipient apps rely on these broadcasts."]]