I have created BroadcastReceiver to schedule my Service execution every 30 seconds. This is what I have in AndroidManifest.xml :
<receiver android:name="MyScheduleReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>
This is working great now, but only after I added QUICKBOOT_POWERON action. Before that I had only BOOT_COMPLETED and when I reboot emulator or phone while debugging, my service would never start. So my question is what is the difference between these two and when to use each?
Houf
Intent android.intent.action.BOOT_COMPLETED
is received after a "cold" boot.
Intent android.intent.action.QUICKBOOT_POWERON
is received after a "restart" or a "reboot".
Check here
来源:https://stackoverflow.com/questions/27753891/difference-between-boot-completed-and-quickboot-poweron-on-android