android.permission.RECEIVE_BOOT_COMPLETED does not work
NickName:jay Ask DateTime:2016-05-17T17:55:37

android.permission.RECEIVE_BOOT_COMPLETED does not work

I want my application to start at bootup, but the following code does not work. I have seen few more similar threads, but unable to find a solution that works for me.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="app.com.blynq.player">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:largeHeap="true"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <receiver
            android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
            android:name="app.com.blynq.services.BootReceiver" >
            <intent-filter >
                <action android:name="android.intent.action.SCREEN_ON" />
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>

    </application>

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

</manifest>

My Broadcast receiver:

public class BootReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
    if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {

        Intent pushIntent = new Intent(context, MainActivity.class);
        pushIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(pushIntent);
    }
}

Am I missing something very trivial ? Is this combination of permissions I've used are unusual ?

Copyright Notice:Content Author:「jay」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/37272823/android-permission-receive-boot-completed-does-not-work

More about “android.permission.RECEIVE_BOOT_COMPLETED does not work” related questions

android.permission.RECEIVE_BOOT_COMPLETED does not work

I want my application to start at bootup, but the following code does not work. I have seen few more similar threads, but unable to find a solution that works for me. &lt;?xml version="1.0" encod...

Show Detail

BroadcastReceiver requires android.permission.RECEIVE_BOOT_COMPLETED

My Android app needs to be notified about the BOOT_COMPLETED event. AndroidManifest.xml contains &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt; and inside &lt;

Show Detail

confusion in using android:permission for android.permission.RECEIVE_BOOT_COMPLETED

Please have a look at the following Maniferst.xml file &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="pack.s

Show Detail

android.permission.RECEIVE_BOOT_COMPLETED does not launch activity at boot

I have a BootUpReceiver class which I'm attempting to use with RECEIVE_BOOT_COMPLETED to launch an Activity when the device boots. The problem is - it does not seem to do so when I launch the app t...

Show Detail

Do call to android.os.Looper.loop() require android.permission.RECEIVE_BOOT_COMPLETED to be specified in AndroidManifest.xml

At work, we run our apps through a security scan tool that does static analysis for vulnerabilities. Sometimes it flags things that aren't security related but could cause problems in some other w...

Show Detail

Is android.permission.RECEIVE_BOOT_COMPLETED not required?

Does anyone know why my application still receives the ACTION_BOOT_COMPLETED broadcast even when my app doesn't have the permission android.permission.RECEIVE_BOOT_COMPLETED in the manifest file? I

Show Detail

Android: how does application Protector app work?

Can anyone shed some light on how applications like App Protector , ES Security Manager (app protector part) work Basically what you do is set all the apps you want to lock in there. then whenever...

Show Detail

BroadCast Receiver does not work on boot

My application contains a broadcast receiver class only. I just want to display a message in the logcat when the phone is fully booted. For this I used "ACTION_BOOT_COMPLETED". BroadCast receiver ...

Show Detail

Implementing a service in android.permission.RECEIVE_BOOT_COMPLETED

I take below sample in net searching. I implemented the sample with some modification, but it shows error after rebooting the phone. I also pasting source code i used in the sample, please help m...

Show Detail

Auto starting application after phone boot does not work in Android 4.4.2,but works in Android 5

now I want to auto start my app after booting android phone. Now it works in android 5, but does not work in Android 4.4.2. In Android 4.4.2, only works in case I enable my app in startup manager. Is

Show Detail