EncodingUtils.getBytes() 过时了怎么办

2017-03-16  本文已影响0人  F野鸽子
webview.postUrl(url, EncodingUtils.getBytes(arg, "base64");

提示 EncodingUtils 过时了怎么办?

改成如下:

WebView webview = new WebView(this);
setContentView(webview);
String url = "http://www.example.com";
String postData = "username=" + URLEncoder.encode(my_username, "UTF-8") + "&password=" + URLEncoder.encode(my_password, "UTF-8");
webview.postUrl(url,postData.getBytes());
上一篇 下一篇

猜你喜欢

热点阅读