Skip to content Skip to sidebar Skip to footer

Proximity Alerts Not Working After Phone Reboot

I am using proximity alerts in one of my applications, however it seems that whenever I reset my phone (via battery pull) or just in general, the proximity alerts are no longer act

Solution 1:

You must reset the alerts. The Android OS does not persist your alerts when rebooting, that's up to your app. Create a BroadcastReceiver (I called mine BootReceiver in my example below) to handle the "android.intent.action.BOOT_COMPLETED" action (this is defined in the manifest). With the BroadcastReceiver you can then restart all of your alerts. Don't forget to add the "android.permission.RECEIVE_BOOT_COMPLETED" permission.

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
...
<receiver android:name=".BootReceiver">
<intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>

Post a Comment for "Proximity Alerts Not Working After Phone Reboot"