Webview not able to load https url in android?

前端 未结 9 1371
别跟我提以往
别跟我提以往 2020-12-29 08:14

I am implementing webview application in android. When i am trying to load https url one or two times it finishes the activity. Agian tryin

9条回答
  •  南笙
    南笙 (楼主)
    2020-12-29 08:46

    One possibility here is a race condition.

    You are loading https://www.facebook.com/ before setting up the WebViewClient, so there is a possibility that your implementation of OnReceivedSslError() will never get called if you get a quick enough response from facebook.

    This would explain why it works for some people, not for others, and always works if the page is reloaded.

    Also, I think you should just be returning false from shouldOverrideUrlLoading() if you want the page to load rather than attempting to reload the page - this might cause an infinite recursion / crash - possibly depending upon timing.

提交回复
热议问题