Code example for JSONArray

Methods: getJSONObject

0
	@Override 
	public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
		if ("showEmailComposer".equals(action)) {
			 
			try { 
				JSONObject parameters = args.getJSONObject(0);
				if (parameters != null) {
					sendEmail(parameters);
				} 
			} catch (Exception e) {
 
			} 
			callbackContext.success();
			return true; 
		} 
		return false;  // Returning false results in a "MethodNotFound" error. 
	} 
 
	private void sendEmail(JSONObject parameters) {