原生Android 9系统无法使用DownloadManager解决办法

原生的Android 9系统,在使用DownloadManager下载文件时,文件已经加入到下载队列里,但一直无法开始下载。原因是系统会检测网络是否连通(通过连接Google的服务器)

通过修改连接的服务器可以解决此问题,下面在命令行界面执行以下命令:

adb shell settings put system captive_portal_http_url http://captive.v2ex.co/generate_204
adb shell settings put system captive_portal_https_url http://captive.v2ex.co/generate_204
adb shell settings put system captive_portal_mode 1
adb shell settings put system captive_portal_use_https 1

用adb shell settings list system可以查看当前配置的值。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 调试桥 Android 调试桥 (adb) 是一个通用命令行工具,其允许您与模拟器实例或连接的 A...
    guanjm阅读 1,529评论 0 1
  • android开发环境中,ADB是我们进行android开发经常要用的调试工具,它的使用当然是我们Android开...
    Memebox阅读 6,146评论 0 32
  • 官网 中文版本 好的网站 Content-type: text/htmlBASH Section: User ...
    不排版阅读 4,485评论 0 5
  • 周践行:持续小组早打卡,“不起就出局”集体组织打卡,入睡较晚早晨会睡回笼觉;每天坚持花椒水泡脚;持续早间洗浴时间听...
    姜皓添William阅读 294评论 0 0
  • 今天我们仍然需要鲁迅先生,他是民族的魂,是我们中华民族的脊梁。 鲁迅是20世纪中国伟大的思想家与文学家,接受了传统...
    赮_红雨阅读 795评论 2 8