Webview shouldOverrideUrlLoading not getting called

前端 未结 4 1968
难免孤独
难免孤独 2021-01-02 15:30

I am making an ebook reader which uses epub format to load books into webviews. In some of the books there is an anchor link to some portions in the same chapter. Each chapt

4条回答
  •  盖世英雄少女心
    2021-01-02 16:18

    In my case it didn't work because of POST requests on web page. shouldOverrideUrlLoading:

    Note: This method is not called for POST requests.

    Note: This method may be called for subframes and with non-HTTP(S) schemes; calling WebView#loadUrl(String) with such a URL will fail.

    Override shouldInterceptRequest instead (one or both versions). See also https://medium.com/@madmuc/intercept-all-network-traffic-in-webkit-on-android-9c56c9262c85.

提交回复
热议问题