36

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?

azec-pdx
  • 4,790
  • 6
  • 56
  • 87
  • check this http://stackoverflow.com/questions/7978403/boot-receiver-not-work – KomalG Jan 03 '15 at 10:49
  • That's exactly where I found working solution - but my phone is not HTC and it still wasn't working without QUICKBOOT_POWERON. That's the reason why I opened new question in order to get more general answer. – azec-pdx Jan 03 '15 at 10:52
  • com.htc.intent.action.QUICKBOOT_POWERON (and not android.intent.action...) http://stackoverflow.com/questions/11692923/any-way-to-know-if-device-booted-from-a-fastboot – Nublodeveloper Jul 13 '15 at 09:04

1 Answers1

28

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

madlymad
  • 6,367
  • 6
  • 37
  • 68
Houf
  • 577
  • 5
  • 19
  • I restarted my phone (Lenovo P2) an received a Boot_completed intent... didn't check the other one though. – Mitulát báti Apr 14 '19 at 13:49
  • 3
    I think it's applicable only for Google emulator. Real devices always do "cold" boot – Dmytro Batyuk Jul 07 '20 at 08:13
  • Is this still useful nowadays to use `android.intent.action.QUICKBOOT_POWERON` ? If not, from which API ? – android developer Aug 17 '20 at 10:00
  • 3
    But that permission is not anywhere! Where actually did people heard of this permissio? Should it even be used if Android Studio doesn't find it?? I have internal/hidden APIs showing and it still doesn't exist, it seems. – Edw590 Dec 27 '20 at 23:50