framework/src/org/apache/cordova/App.java
/**
     * Executes the request and returns PluginResult.
     *
     * @param action        The action to execute.
     * @param args          JSONArry of arguments for the plugin.
     * @param callbackId    The callback id used when calling back into JavaScript.
     * @return              A PluginResult object with a status and message.
     */
Executes the request and returns PluginResult.
@param action        The action to execute.
@param args          JSONArry of arguments for the plugin.
@param callbackId    The callback id used when calling back into JavaScript.
@return              A PluginResult object with a status and message.
Executes the request and returns PluginResult . @param action The action to execute . @param args JSONArry of arguments for the plugin . @param callbackId The callback id used when calling back into JavaScript . @return A PluginResult object with a status and message .
public PluginResult execute(String action, JSONArray args, String callbackId) {
        PluginResult.Status status = PluginResult.Status.OK;
        String result = "";
        try {
            if (action.equals("clearCache")) {
                this.clearCache();
            }
            else if (action.equals("show")) { 
                cordova.getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        webView.postMessage("spinner", "stop");
                    }
                });
            }
            else if (action.equals("loadUrl")) {
                this.loadUrl(args.getString(0), args.optJSONObject(1));
            }
            else if (action.equals("cancelLoadUrl")) {
                this.cancelLoadUrl();
            }
            else if (action.equals("clearHistory")) {
                this.clearHistory();
            }
            else if (action.equals("backHistory")) {
                this.backHistory();
            }
            else if (action.equals("overrideButton")) {
                this.overrideButton(args.getString(0), args.getBoolean(1));
            }
            else if (action.equals("overrideBackbutton")) {
                this.overrideBackbutton(args.getBoolean(0));
            }
            else if (action.equals("exitApp")) {
                this.exitApp();
            }
            return new PluginResult(status, result);
        } catch (JSONException e) {
            return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
        }
    }
public PluginResult execute ( String action , JSONArray args , String callbackId ) { PluginResult . Status status = PluginResult . Status . OK ; String result = "" ; try { if ( action . equals ( "clearCache" ) ) { this . clearCache ( ) ; } else if ( action . equals ( "show" ) ) { cordova . getActivity ( ) . runOnUiThread ( new Runnable ( ) { public void run ( ) { webView . postMessage ( "spinner" , "stop" ) ; } } ) ; } else if ( action . equals ( "loadUrl" ) ) { this . loadUrl ( args . getString ( 0 ) , args . optJSONObject ( 1 ) ) ; } else if ( action . equals ( "cancelLoadUrl" ) ) { this . cancelLoadUrl ( ) ; } else if ( action . equals ( "clearHistory" ) ) { this . clearHistory ( ) ; } else if ( action . equals ( "backHistory" ) ) { this . backHistory ( ) ; } else if ( action . equals ( "overrideButton" ) ) { this . overrideButton ( args . getString ( 0 ) , args . getBoolean ( 1 ) ) ; } else if ( action . equals ( "overrideBackbutton" ) ) { this . overrideBackbutton ( args . getBoolean ( 0 ) ) ; } else if ( action . equals ( "exitApp" ) ) { this . exitApp ( ) ; } return new PluginResult ( status , result ) ; } catch ( JSONException e ) { return new PluginResult ( PluginResult . Status . JSON_EXCEPTION ) ; } }
Executes the request and returns PluginResult.
Executes the request and returns PluginResult .
// TODO @bc - Not in master branch.  When should this be called?