http://www.heapoverflow.me/question-webview-loadurlurl-headers-not-working-in-android-31203905

It's beceause of Cookie Policy, to fix it, you should add this :

public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init(); // Allow third party cookies for Android Lollipop
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
WebView webView = (WebView)super.appView;
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptThirdPartyCookies(webView,true);
} super.loadUrl(Config.getStartUrl());
}
Answer for 'WebView.loadUrl(url, headers) not working in android' is helpful, give it a up vote!5Answer for 'WebView.loadUrl(url, headers) not working in android' is not helpful, cast a down vote
user2906641 Posted at 2015-07-27 07:51:35Z

if you are using Android Lollipop, then

CookieManager.getInstance().setAcceptCookie(true);

won't work. You need to use

CookieManager.getInstance().setAcceptThirdPartyCookies(true);

android 5.0 webview坑的更多相关文章

  1. android 4.0 webview 无法播放视频

    Android4.0+webview中不能播放网页视频解决方法: 1.修改AndroidManifest.xml文件 在application中添加如下属性 android:hardwareAccel ...

  2. Android 8.0 的部分坑及对应解决方法

    虽然 Android 9.0 都已经面世了,本篇文章写的有点迟了. 但是迟到好过不到,因此基于此这边还是记录一下项目中遇到的 Android 8.0 的坑及对应解决方法. 每次系统升级,虽然系统功能更 ...

  3. Android 各个版本WebView

    转载请注明出处   http://blog.csdn.net/typename/ powered by miechal zhao : miechalzhao@gmail.com 前言: 根据Googl ...

  4. Android 各个版本号WebView

    转载请注明出处   http://blog.csdn.net/typename/ powered by miechal zhao : miechalzhao@gmail.com 前言: 依据Googl ...

  5. Android 5.0及以上版本使用webview不能存储第三方Cookies解决方案

    Android 5.0以上的手机使用原生WebView浏览网页,在进行登录的时候会提示验证码错误,通过查找5.0以上系统的api文档,发现5.0以上版本的webview做了较大的改动,如:同步cook ...

  6. 当WebView运行在特权进程时抛出安全异常,Hook方式解决方案(包含对Android 8.0的处理)

    1.问题起源报错语句是:java.lang.UnsupportedOperationException: For security reasons, WebView is not allowed in ...

  7. 浅谈Android Studio3.0更新之路(遇坑必入)

    >可以参考官网设置-> 1 2 >> Fantasy_Lin_网友评论原文地址是:简书24K纯帅豆写的我也更新一下出处[删除]Fa 转自脚本之家 浅谈Android Studi ...

  8. Android 5.0 5.1 webview 闪退问题

    自定义webview /** * 处理Android 5.0 5.1 webview 闪退 */ class MyWebView : WebView { companion object{ priva ...

  9. Android 5.0 到 Android 6.0 + 的深坑之一 之 .so 动态库的适配

    (原创:http://www.cnblogs.com/linguanh) 目录: 前序 一,问题描述 二,为何会如此"无情"? 三,目前存在该问题的知名SDK 四,解决方案,1 对 ...

随机推荐

  1. ObjC.class-cluster

    class cluster In a class cluster, only an abstract superclass is public. Allocating an instance actu ...

  2. acm入门编成题

    http://wenku.baidu.com/view/c8f2f64acf84b9d528ea7aee.html

  3. iOS9的一些问题

    1.App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. ...

  4. Servlet中使用Log4j2

    因为Servlet常用的版本有两个,即2.5与3.0.要在web application中使用Log4j2,还需要加入log4j-web的jar包.log4j通过web.xml中的context参数l ...

  5. Activity的四种启动模式详解

    Activity的启动模式在清单文件AndroidManifest.xml中的Activity属性中进行设置: 如:<activity android:name=".MainActiv ...

  6. (并查集)~APTX4869(fzu 2233)

    http://acm.fzu.edu.cn/problem.php?pid=2233 Problem Description 为了帮助柯南回到一米七四,阿笠博士夜以继日地研究APTX4869的解药.他 ...

  7. selenium通过WebDriverWait实现ajax测试,实现等页面元素加载完成

    WebDriverWait(driver, 10)10秒内每隔500毫秒扫描1次页面变化,当出现指定的元素后结束. http://fox1984.iteye.com/blog/1225265new W ...

  8. iOS 开发中的CGFloat,CGPoint,CGSize和CGRect

    CGGeometry类定义几何元素的结构和操作集合元素的函数 1. 数据类型 CGFloat: 浮点值的基本类型 CGPoint: 表示一个二维坐标系中的点 CGSize: 表示一个矩形的宽度和高度 ...

  9. EmberJs之Ember-Data

    写在前面 最近比较忙,换了新工作还要学习很多全新的技术栈,并给自己找了很多借口来不去坚持写博客.常常具有讽刺意味的是,更多剩下的时间并没有利用而更多的是白白浪费,也许这就是青春吧,挥霍吧,这不是我想要 ...

  10. win7 64系统安装oracle客户端使用PL/SQL Developer工具

    1)安装Oracle 11g 64位,我用的版本下载地址: http://www.oracle.com/technetwork/database/enterprise-edition/download ...