Code example for DialogFragment

Methods: getDialog

0
        return alertdialog;
    } 
 
    public void onTextChanged(CharSequence charsequence, int i, int j, int k)
    { 
        AlertDialog alertdialog = (AlertDialog)getDialog();
        if(alertdialog != null)
        { 
            Button button = alertdialog.getButton(-1);
            boolean flag;
            if(charsequence.toString().trim().length() > 0)
                flag = true;
            else 
                flag = false;
            button.setEnabled(flag);
        } 
    } 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE