dialog.show(ft, UNTRUSTED_CERT_DIALOG_TAG);\r
}\r
\r
- /**\r
- * Show authentication dialog \r
- */\r
- public void showAuthenticationDialog(WebView webView, HttpAuthHandler handler) {\r
- // Show a dialog for the authentication\r
- createAuthenticationDialog(webView, handler);\r
- \r
- }\r
\r
/**\r
* Show untrusted cert dialog \r
}\r
\r
/**\r
- * Create dialog for request authentication to the user\r
+ * Create and show dialog for request authentication to the user\r
* @param webView\r
* @param handler\r
*/\r
- private void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) {\r
+ public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) {\r
\r
// Show a dialog with the certificate info\r
CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler);\r
public void onReceivedHttpAuthRequest (WebView view, HttpAuthHandler handler, String host, String realm) {
Log_OC.d(TAG, "onReceivedHttpAuthRequest : " + host);
- ((AuthenticatorActivity)mContext).showAuthenticationDialog(view, handler);
+ ((AuthenticatorActivity)mContext).createAuthenticationDialog(view, handler);
}
@Override
public void onClick(DialogInterface dialog, int which) {
if (which == AlertDialog.BUTTON_POSITIVE) {
- String username = mUsernameET.getText().toString().trim();
- String password = mPasswordET.getText().toString().trim();
+ String username = mUsernameET.getText().toString();
+ String password = mPasswordET.getText().toString();
// Proceed with the authentication
mHandler.proceed(username, password);
- dialog.dismiss();
} else if (which == AlertDialog.BUTTON_NEGATIVE) {
- dialog.dismiss();
mWebView.stopLoading();
((AuthenticatorActivity)getActivity()).doNegativeAuthenticatioDialogClick();
}
+
+ dialog.dismiss();
}