Search code examples
androidandroid-intentandroid-pendingintentrestart

Does a PendingIntent survive device restart?


Does a PendingIntent submitted to LocationServices survive device restart? If not, what's the best practice for re-submitting without requiring the user to relaunch the app?


Solution

  • Does a PendingIntent submitted to LocationServices survive device restart?

    No.

    If not, what's the best practice for re-submitting without requiring the user to relaunch the app?

    Use an ACTION_BOOT_COMPLETED BroadcastReceiver to get control on a reboot, then set up your location requests again.