yayiji
V2EX  ›  Android

Android webview 如何阻拦下载链接跳转

  •  
  •   yayiji · Feb 25, 2021 · 12694 views
    This topic created in 2084 days ago, the information mentioned may be changed or developed.

    Android webview 如何阻拦下载链接跳转

    如下图,点击页面的下载按钮后跳转到了下个页面,下载触发点在 shouldOverrideUrlLoading 之后,因此在无法 shouldOverrideUrlLoading 中阻拦。此种情况如何阻拦页面跳转?

    webview 使用 setDownloadListener 触发下载

    1 replies  •  2021-02-25 17:21:34 +08:00
    coolesting
    coolesting
    Feb 25, 2021
    1
    还有个 shouldInterceptLoadRequest
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   954 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:48 · PVG 03:48 · LAX 11:48 · JFK 14:48
    ♥ Do have faith in what you're doing.