Created
November 18, 2013 05:15
-
-
Save sakurabird/7522877 to your computer and use it in GitHub Desktop.
webviewでAndroid4.0の場合、hostにポート番号が付加されてしまう件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 認証リクエストがあった場合の挙動 | |
@Override | |
public void onReceivedHttpAuthRequest(WebView view, | |
HttpAuthHandler handler, String host, String realm) { | |
// Android4.0の場合、hostにポート番号が付加されてしまうので、splitでポート番号を排除 | |
String[] up = view.getHttpAuthUsernamePassword( | |
host.split(":")[0], realm); | |
if (up != null && up.length == 2) { | |
handler.proceed(up[0], up[1]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment