当前位置: 代码迷 >> Android >> Android不惯用代码(1)
  详细解决方案

Android不惯用代码(1)

热度:38   发布时间:2016-04-28 04:28:38.0
Android不常用代码(1)
目录

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);
  相关解决方案