大马资讯论坛 - 马来西亚中文资讯平台

标题: [教学] Android webview facebook dialog oauth client keep reloading [打印本页]

作者: 资讯王    时间: 2015-4-12 00:16
标题: [教学] Android webview facebook dialog oauth client keep reloading
在 Android - 5.0 Lollipop 一直刷新个不停
[Solved] Android webview facebook dialog oauth client keep reloading - non stop
window.location.assign(https://www.facebook.com/dialog/oauth?client_id=)

加这个Add CookieManager.getInstance()
  1. WebView myWebView = (WebView)rootView.findViewById(R.id.fb);
  2.                        
  3. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  4.     CookieManager.getInstance().setAcceptThirdPartyCookies(myWebView, true);
  5. }
  6.                        
  7. myWebView.getSettings().setAppCacheEnabled(true);
  8. myWebView.getSettings().setJavaScriptEnabled(true);
  9. myWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
  10. myWebView.getSettings().setSupportMultipleWindows(true);
复制代码





欢迎光临 大马资讯论坛 - 马来西亚中文资讯平台 (http://freeinfo.com.my/) Powered by Discuz! X3.3