Ajith K P Ajith K P - 10 months ago 55
Android Question

Android After Reboot Broadcast Reciver is not running

i used this permisions,

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

and receiver is

<receiver android:name=".auth.NotificationBroadcast"
android:enabled="true" >
<action android:name="android.intent.action.BOOT_COMPLETED" />

and reciver is

public void onReceive(Context context, Intent intent) {


if (intent != null) {
String action = intent.getAction();

switch (action) {
System.out.println("Called on REBOOT");
// start a new service and repeat using alarm manager


but after reboot the mobile it is not calling in lollipop,but in marshmellow it is running

Answer Source

try to put this line in your receiver's intent-filter.

<action android:name="android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE" />

If your application is installed on the SD card, you should register this to get the android.intent.action.BOOT_COMPLETED event.

Updated: Since your app is using alarm service, it should not be installed on external storage. Reference: http://developer.android.com/guide/topics/data/install-location.html