WebView-Cookie

android HttpClient+WebView 同步cookie

一世执手 提交于 2020-04-13 01:05:43
android客户端通过httpClient或者httpUrlConnection进行登录后,为了把登录状态同步到webView中,这时需要进行cookie的同步 参考: http://segmentfault.com/a/1190000002877843 一.cookie同步方式 下面是登录线程: public class LoginThread extends Thread{ private Handler loginHandler; public LoginThread(Handler loginHandler) { this.loginHandler = loginHandler; } @Override public void run() { List<String> cookieLst = new ArrayList<String>(); HttpParams httpParams = new BasicHttpParams(); ConnManagerParams.setMaxTotalConnections(httpParams, 5); ConnManagerParams.setTimeout(httpParams, 15*1000); HttpConnectionParams.setSoTimeout(httpParams, 10*1000);