Share Coding

Tutorials, Problems, Stuffs …

Tag Archives: javascript

Return value from JavaScript to Android Webview

WebView WebView1 = new WebView(this);
private WebChromeClient MyWebChromeClient = new WebChromeClient() {
	public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
		try {
			// "message" is the text shown in alert box
			Log.v("message",, "UTF-8"));
		} catch (UnsupportedEncodingException e) {
		return true;
//If the "message" text is garbled, you can try to add this on php header: ini_set('default_charset','utf-8');