I am developing an Android application that I want to allow users to install on their SD card (http://developer.android.com/guide/appendix/install-location.html). However, the application has some alarms created through AlarmManager. According to the Android developer’s guide (the link I included), if the external media (SD card) on which the application is installed is disabled, the following will happen: "Your alarms registered in AlarmManager will be canceled. Re-registration of any alarms when rebooting external storage. "
Is there any way to “wake up” my application so that I can redistribute the alarms when reinstalling the SD card? Maybe use a receiver with some intent filter? I tried to add a receiver for android.intent.action.MEDIA_MOUNTED, but this did not work (perhaps because applications installed externally do not receive translation of this intention or because application binaries are not available immediately after installing the media and that intent is being broadcast?). Any other intentions anyone can suggest? Or some other way to do this? Android .intent.action.EXTERNAL_APPLICATIONS_AVAILABLE intentions (http://developer.android.com/reference/android/content/Intent.html#ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE) is similar to what I need, but the documents say that the applications on external media will not receive of this intention.
source share