WebViewを使ってBasic認証のページにアクセスする
意外と面倒なのでメモ
protected void onCreate(Bundle icicle) { super.onCreate(icicle); int WC = ViewGroup.LayoutParams.WRAP_CONTENT; webview = new WebView(this); webview.setWebViewClient(new WebViewClient() { @Override public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) { System.out.println("onReceivedHttpAuthRequest, host:realm = " + host + ":" + realm); handler.proceed("ユーザID", "パスワード"); } }); linearLayout.addView(webview, createParam(WC, WC)); webview.loadUrl("http://ベーシック認証のページ"); }