Code example for JSONArray

Methods: getString

0
	@Override 
	public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
		if ("show".equals(action)) {
			String text = "Please wait";
			try { 
				text = args.getString(0);
			} catch (Exception e) {
				LOG.d("WaitingDialog", "Text parameter not valid, using default"); 
			} 
			showWaitingDialog(text);
			callbackContext.success();
			return true; 
		} else if ("hide".equals(action)) {
			hideWaitingDialog(); 
			callbackContext.success();
			return true; 
		} 
		return false; 
	} 
	 
	public void showWaitingDialog(String text) {