Code example for Context

Methods: unregisterReceiver

0
        public void onReceive(Context context, Intent intent) {
            dialog.cancel();
        } 
 
        public void onDismiss(DialogInterface unused) {
            mContext.unregisterReceiver(this);
        } 
    } 
 
    /** 
     * Request a clean shutdown, waiting for subsystems to clean up their 
     * state etc.  Must be called from a Looper thread in which its UI 
     * is shown. 
     * 
     * @param context Context used to display the shutdown progress dialog. 
     * @param reason code to pass to the kernel (e.g. "recovery"), or null. 
     * @param confirm true if user confirmation is needed before shutting down. 
     */ 
    public static void reboot(final Context context, String reason, boolean confirm) {
        mReboot = true;
        mRebootSafeMode = false;