1:Webview
2:js交互
1:Webview 除了浏览器根本不会用到
String url = etAddress.getText().toString(); if (URLUtil.isNetworkUrl(url)) webView.loadUrl(url); else Toast.makeText(this, "输入的网址不正确.", Toast.LENGTH_LONG).show();
<WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" />
2:js交互附带一个js交互的Demo
webView.loadDataWithBaseURL(null, startRandomMoveJavascript, "text/html", "utf-8", null);