Code example for JsPromptResult

Methods: confirm

0
 
	@Override 
	public boolean onJsPrompt(WebView view, String url, String message,
			String defaultValue, JsPromptResult r) {
		if (message != null && message.startsWith("calabash:")) {
			r.confirm("CALABASH_ACK");
			System.out.println("onJsPrompt: " + message);
			String jsonResponse = message.replaceFirst("calabash:", "");
			scriptFuture.setResult(jsonResponse);			
			return true; 
		} else { 
			if (mWebChromeClient == null) {
				r.confirm("CALABASH_ERROR");
				scriptFuture.complete();
				return true; 
			} else { 
				// TODO I'm not what this case does... 
				return mWebChromeClient.onJsPrompt(view, url, message,
						defaultValue, r);
			} 
		}