Skip to content Skip to sidebar Skip to footer

Getting 401.2 Error In Android Webviewclient

I am developing a mobile app to access a intranet site in android. SSL certificate of this website is fine. This I can say because when I open the site in android browser, it doesn

Solution 1:

Try to override onReceivedHttpAuthRequest() with in your WebViewClient like this:

import android.webkit.HttpAuthHandler;

HttpAuthHandler

...

@OverridepublicvoidonReceivedHttpAuthRequest(WebView view,HttpAuthHandler handler, String host, String realm) {

        super.onReceivedHttpAuthRequest(view, handler, host, realm);

        view.setHttpAuthUsernamePassword(host, realm, username, password);

    }

Resource Link: Link

See if this works for you.

If doesn't, you can try this as well :)

Post a Comment for "Getting 401.2 Error In Android Webviewclient"