You can check the value when inputting with TextWatcher
. Or set custom onClickListener to the positive button.
AlertDialog.Builder builder = new AlertDialog.Builder();
// build dialog
AlertDialog dialog = builder.create();
dialog.setOnShowListener(new DialogInterface.OnShowListener(){
@Override
public void onShow(DialogInterface dialogInterface){
((AlertDialog)dialogInterface).getButton(AlertDialog.BUTTON_POSITIVE)
.setOnClickListener(// check value here)
}
}
dialog.show();
remember to invoke dialogInterface.dismiss()
when you ready to dismiss it.