I am using a webview to load a webpage which requires basic HTTP authentication. I have done some Google search and I knew it can be done by using a WebClientView and over-writing onReceivedHttpAuthRequest.
like this
webView.setWebViewClient(new WebViewClient() {
public void onReceivedHttpAuthRequest(WebView view,
HttpAuthHandler handler, String host, String realm) {
// TODO Auto-generated method stub
handler.proceed(username, password); //question is here,let user input these.
}
});
what I have already tried is I use a Login activity to get the users’s input and pass the parameter back to this webview activity.
But is this the best way of doing it?
try this method with HttPget and HttpPost
This is sample code for Authentication code in Httpget . You can try by this w’t you want…