Tôi có một số BroadcastReceiver
sau sẽ chạy sau khi hoàn thành khởi động. Tôi đã thử nghiệm nó trên thiết bị của tôi Xiaomi (Redmi 1s), thiết bị không chạy, trong khi trên các thiết bị khác như Samsung nó đang chạy như mong đợi.Khởi động phát sóngReceiver không hoạt động trên các thiết bị Xiaomi
public class DeviceBootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
Toast.makeText(context, "I am Running", Toast.LENGTH_SHORT).show();
}
}
}
Tôi đã đặt quyền trong Tệp kê khai.
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
Và sau đây là thu phát sóng của tôi:
<receiver android:name=".receiver.DeviceBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
Bạn đã giúp tôi rất nhiều! Tôi không biết điều này :) –
@Dimitar: oh! Tôi rất vui vì nó đã giúp bạn. – zeeali
Tôi không thể thấy tùy chọn Tự khởi động trong Xiaomi hm note1 LTE – himCream