Code example for JSONObject

Methods: put, toString

0
    } 
 
    @Override 
    public void onCancel(DialogInterface aDialog) {
        ThreadUtils.assertOnUiThread(); 
        JSONObject ret = new JSONObject();
        try { 
            ret.put("button", -1);
        } catch(Exception ex) { }
        finishDialog(ret);
    } 
 
    public void finishDialog(JSONObject aReturn) {
        mInputs = null;
        mButtons = null;
        mDialog = null;
        mSelected = null;
        try { 
            aReturn.put("guid", mGuid);
        } catch(JSONException ex) { }
 
        if (mPromptQueue != null) {
            mPromptQueue.offer(aReturn.toString());
        } 
 
        // poke the Gecko thread in case it's waiting for new events 
        GeckoAppShell.sendEventToGecko(GeckoEvent.createNoOpEvent()); 
 
        if (mCallback != null) {
            mCallback.onPromptFinished(aReturn.toString());
        } 
        mGuid = null;
    } 
 
    private void processMessage(JSONObject geckoObject) {