Load HTTPS Pages/URLs in Android Webview

It is a very common and known issue that we cannot load pages with the SSL in Android Webview. The solution to this could be varying from making code changes to the backend so that the service recognizes this situation and redirects to a non SSL based resources to overriding the onReceivedSslError method.

However, when we do not have control on the backend services, we somehow need to fix this from the tools that we have access to. In that case the obvious solution is to override the onReceivedSslError method. Paste the below code in your corresponding Activity class:

public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {

This will work just fine when you test your app in your phone or on the simulator. When you submit your app to the Play Store, you could possibly get the following Security alert

Security alert Your application has an unsafe implementation of the WebViewClient.onReceivedSslError handler. 

Rightly so, since you are doing this without letting the user know about the navigation from https to http. We will solve this issue in the next post.

See you around.
Share on Google+

About Unknown

Sujit Horakeri is a game freak just like any other next door guy you would come across. He is a Web Developer by Profession, Game Developer by Choice.


  1. Very nice article.Keep posting. i will wait for your next article. Thanks!
    happy wheels 2.0

  2. very impressive article. thanks for sharing it
    az baby names

  3. Very informative article.it is written a well organized manner.it is really interesting to read this article.It contain so many vital information to the readers.Thank you for giving this good article to us.Visit custom dissertation online to get more articles like this.

  4. This is the most important article for Android users.It informs us about the problem of Android webview. Thanks for posting this useful article.ourbdshop

  5. Be positive article for android users and the vital information of android webview..Thanks for share it..https://ourbdshop

  6. Incredible Article… I want to read your articles in light of the fact that your composition style is too great, it is extremely useful for us all and I never get exhausted while reading your article on the grounds that...CFA Audit
    Vendor Reconciliation
    CA Firms

  7. Thanks so much for this great article; this is the kind of thing that keeps me going through the day.


  8. It's very helpful for me. Thank you so much for sharing this post!

  9. well this is good blog, why you should move there bouncing balls , red ball

  10. Excellent blog I visit this blog it's really awesome. The important thing is that in this blog content written clearly and understandable. The content of information is very informative.
    oracle fusion financials classroom training
    Workday HCM Online Training
    Oracle Fusion Financials Online Training
    Oracle Fusion HCM Online Training
    Oracle Fusion SCM Online Training
    Oracle Fusion HCM Classroom Training

  11. I did not know that! Thanks!
    Play online games happy wheels & friv