Dead loop in android webview backkey for redirect href link

后端 未结 4 2281
挽巷
挽巷 2021-02-14 10:30

I got to a dead loop in Android webview application with backkey while dealing with redirect links.

For example, when my webview started, it goes to link0.

In l

4条回答
  •  广开言路
    2021-02-14 11:26

    I had a same problem and solved it. Here is my answer.

    When I click the first link(www.new.a) it automatically redirects other link(mobile.new.a). Usually the links redirect two or three, and my solution have been worked on almost every redirect links. I hope this answer help you out with annyoing redirecting links.

    I finally figured out that. You need a WebViewClient with four APIs. There are shouldOverrideUrlLoading(), onPageStarted(), onPageFinished(), and doUpdateVisitedHistory() in the WebViewClient. All the APIs you need is API 1 so don't worry about.

    Here is my answer. Check out that! :)

提交回复
热议问题