Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with automatically starting app
    primarykey
    data
    text
    <p>I see this has been asked quite a bit, but I can't seem to resolve my problem with what is out there.</p> <p>My <code>onReceive()</code> method in broadcast receiver isn't being called.</p> <p>Manifest:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.app.test" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name="com.app.test.TestActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:label="@string/app_name" android:theme="@style/FullscreenTheme" &gt; &lt;intent-filter&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;receiver android:enabled="true" android:name=".BootUpReceiver" android:permission="android.permission.RECEIVE_BOOT_COMPLETED"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>BootUpReceiver.java</p> <pre><code>package com.app.test; public class BootUpReceiver extends BroadcastReceiver { private static final String TAG = "TESTAPP_BootUpReceiver"; @Override public void onReceive(Context context, Intent intent) { Log.d(TAG, "helllllllllllllllo"); Toast.makeText(context, "boot completed received", Toast.LENGTH_LONG).show(); // Intent i = new Intent(context, TestActivity.class); // i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // context.startActivity(i); } } </code></pre> <p>Have tried using the entire path instead of <code>.BootUpReceiver</code>, didn't work. Not seeing anything from logcat or any Toast messages. Going into <code>adb shell</code> and emitting the boot_completed event that way doesn't help as the device then reboots.</p> <p>Is there anything I am doing wrong? I read something about applications being inactive when device boots, does that affect my problem?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload