public boolean execute()

in src/android/Notification.java [91:143]


    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
    	/*
    	 * Don't run any of these if the current activity is finishing
    	 * in order to avoid android.view.WindowManager$BadTokenException
    	 * crashing the app. Just return true here since false should only
    	 * be returned in the event of an invalid action.
    	 */
    	if (this.cordova.getActivity().isFinishing()) return true;

        if (action.equals(ACTION_BEEP)) {
            this.beep(args.getLong(0));
        }
        else if (action.equals(ACTION_ALERT)) {
            this.alert(args.getString(0), args.getString(1), args.getString(2), callbackContext);
            return true;
        }
        else if (action.equals(ACTION_CONFIRM)) {
            this.confirm(args.getString(0), args.getString(1), args.getJSONArray(2), callbackContext);
            return true;
        }
        else if (action.equals(ACTION_PROMPT)) {
            this.prompt(args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), callbackContext);
            return true;
        }
        else if (action.equals(ACTION_ACTIVITY_START)) {
            this.activityStart(args.getString(0), args.getString(1));
        }
        else if (action.equals(ACTION_ACTIVITY_STOP)) {
            this.activityStop();
        }
        else if (action.equals(ACTION_PROGRESS_START)) {
            this.progressStart(args.getString(0), args.getString(1));
        }
        else if (action.equals(ACTION_PROGRESS_VALUE)) {
            this.progressValue(args.getInt(0));
        }
        else if (action.equals(ACTION_PROGRESS_STOP)) {
            this.progressStop();
        }
        else if (action.equals(ACTION_DISMISS_PREVIOUS)) {
            this.dismissPrevious(callbackContext);
        }
        else if (action.equals(ACTION_DISMISS_ALL)) {
            this.dismissAll(callbackContext);
        }
        else {
            return false;
        }

        // Only alert and confirm are async.
        callbackContext.success();
        return true;
    }