Abort a shutdown event in Android wait for an Activity completed
<p>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?</p>

<p>Thanks</p>

<p>AndroidManifest.xml</p>

<pre><code>&lt;receiver android:name=".ShutdownReceiver" &gt;
    &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.QUICKBOOT_POWEROFF" /&gt;
        &lt;action android:name="android.intent.action.ACTION_SHUTDOWN" /&gt;
    &lt;/intent-filter&gt;
&lt;/receiver&gt;
</code></pre>

<p>ShutdownReceiver.java</p>

<pre><code>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
    }   
}
</code></pre>
