I have the following code to listen to any Broadcast event related to any Android shutdown event. Can I abort the shutdown event (or have it wait), and kick off an Activity. Only shutdown after when that Activity is completed. If not, any workaround for this?
Thanks
AndroidManifest.xml
<receiver android:name=".ShutdownReceiver" >
<intent-filter>
<action android:name="android.intent.action.QUICKBOOT_POWEROFF" />
<action android:name="android.intent.action.ACTION_SHUTDOWN" />
</intent-filter>
</receiver>
ShutdownReceiver.java
public class ShutdownReceiver extends BroadcastReceiver {
public static final String TAG = MainActivity.class.getSimpleName();
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "Shutdown!");
// Abort the Shutdown signal
// Starts an Activity and wait until the Activity is completed before shutdown
}
}