ログイン時にユーザー名とパスワードを介して認証を取得する認証済み検索 Web ビューを作成しました。検索で Web ビューにアクセスするたびに、既にログインしているユーザーの認証メッセージがポップアップ表示されます (エラーコード 410 だと思います)。同じものを抑制または非表示にするにはどうすればよいですか?
次のコードを使用する必要がありますか?
public void onReceivedError( WebView view, int errorCode, String description, String failingUrl ) {
Toast.makeText(view.getContext(), "Authentication Error", Toast.LENGTH_LONG).show();
if (errorCode == 410) {
//webview.setHttpAuthUsernamePassword(host, realm, username, password);
// Show alert to enter username and password.
// Then, when those are entered in the alert,
// set it through the setHttpAuthUsernamePassword(...)
// shown below and then reload the site.
}
super.onReceivedError(view, errorCode, description, failingUrl);
}
もしそうなら、コードでポップアップを抑制または非表示にするにはどうすればよいですか?