Code example for AlertDialog

Methods: getButton

0
        mPasswordView = (TextView) v.findViewById(R.id.password_edit);
        mPasswordView.setOnEditorActionListener(new OnEditorActionListener() {
            @Override 
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if (actionId == EditorInfo.IME_ACTION_DONE) {
                    mDialog.getButton(AlertDialog.BUTTON_POSITIVE).performClick();
                    return true; 
                } 
                return false; 
            } 
        }); 
 
        String title = mContext.getText(R.string.sign_in_to).toString().replace(
                "%s1", mHost).replace("%s2", mRealm);
 
        mDialog = new AlertDialog.Builder(mContext)
                .setTitle(title)
                .setIconAttribute(android.R.attr.alertDialogIcon)
                .setView(v)
                .setPositiveButton(R.string.action, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {