我需要在我通过HttpsUrlConnection收到的Crosswalk webview中保存一个Cookie。 这就是我初始化Crosswalk Web视图的方式。
private XWalkView xWalkWebView;
private XWalkCookieManager cookieManager;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
xWalkWebView = (XWalkView) findViewById(R.id.xweb_View);
cookieManager = new XWalkCookieManager();
cookieManager.setAcceptCookie(true);
cookieManager.setAcceptFileSchemeCookies(true);
cookieManager.setCookie("http://abc.xyz.com","Authorization=access_token");
}
我需要将cookieManager中的cookie绑定到上面的XwalkView对象。 我非常感谢有关我的要求的任何帮助。
最诚挚的问候,
Mujee
答案 0 :(得分:1)
您好尝试使用httpRequestExecutor.setXWalkCookieManager(cookieManager); 喜欢它描述的 http://www.scriptscoop.com/t/e8eab567179b/set-cookies-programatically-in-crosswalk-webview-on-android.html