를 실행하지 않는 한 나는이 권한 사용 :안드로이드 재부팅 방송 reciver입니다이
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
및 수신기는 다음과 같습니다
<receiver android:name=".auth.NotificationBroadcast" android:enabled="true" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
및 코드에서 수신기는 다음과 같습니다 재부팅 후
@Override
public void onReceive(Context context, Intent intent) {
System.out.println("BroadcastReceiverBroadcast--------------------ReceiverBroadcastReceiverBroadcastReceiver----------------BroadcastReceiver");
if (intent != null) {
String action = intent.getAction();
switch (action) {
case Intent.ACTION_BOOT_COMPLETED:
System.out.println("Called on REBOOT");
// start a new service and repeat using alarm manager
break;
default:
break;
}
}
}
여전히 롤리팝에 불려 가지 않고 있지만, 마시맬로에서는 달리고 있습니다.