Search in sources :

Example 1 with CredentialsDialogFragment

use of com.owncloud.android.ui.dialog.CredentialsDialogFragment in project android by owncloud.

the class AuthenticatorActivity method createAuthenticationDialog.

/**
     * Create and show dialog for request authentication to the user
     * @param webView   Web view to embed into the authentication dialog.
     * @param handler   Object responsible for catching and recovering HTTP authentication fails.
     */
public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) {
    // Show a dialog with the certificate info
    CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler);
    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    ft.addToBackStack(null);
    dialog.setCancelable(false);
    dialog.show(ft, CREDENTIALS_DIALOG_TAG);
    if (!mIsFirstAuthAttempt) {
        showSnackMessage(R.string.saml_authentication_wrong_pass);
    } else {
        mIsFirstAuthAttempt = false;
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) CredentialsDialogFragment(com.owncloud.android.ui.dialog.CredentialsDialogFragment)

Aggregations

FragmentManager (android.support.v4.app.FragmentManager)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 CredentialsDialogFragment (com.owncloud.android.ui.dialog.CredentialsDialogFragment)1