您的位置:首页 > 移动开发

Android通过Post请求网页(WebView)

2014-07-17 19:02 363 查看
WebView wv = (WebView)findViewById(R.id.webView_event);

wv.getSettings().setJavaScriptEnabled(true);

wv.requestFocus();

wv.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);

wv.postUrl(url, EncodingUtils.getBytes("", "base64"));

WebView的postUrl方法说明如下:

Converts the specified string to a byte array. If the charset is not supported the default system charset is used.

Parameters

data

the string to be encoded

charset

the desired character encoding

Returns

· The resulting byte array.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  webview