1

I've been reading a lot on this subject but for some reason I'm unable to make this work. My application records the location of the user every 5 minutes. When the user reboots the phone I'm unable to auto start the app. I'm able to check the location of the user every 5 minutes so the alarms are working.

Here is my android manifest file

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

and the AlarmBroadcastReceiver public class AlarmBroadcastReceiver extends BroadcastReceiver{

public void onReceive(Context context, Intent intent) {
    Log.d("LOG","I've been Called");}

What I'm doing wrong?

fardjad
  • 20,031
  • 6
  • 53
  • 68

1 Answers1

6

Add:

<intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>

To your <receiver> element in the manifest.

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195