こんにちは、次の 2 つの関数があり、ブール値が true または false (ユーザーがテキストを入力したか、EditText に入力しなかった場合) に応じて、以下の「Positivebutton」をブロックできるかどうか疑問に思います。
    private void add() {
            final View addView = getLayoutInflater().inflate(R.layout.add, null);
            new AlertDialog.Builder(this).setTitle("Add a Book").setView(addView)
                    .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {
                            if(addWord((EditText) addView.findViewById(R.id.titleEdit))){
   //Do something, Enable the OK (Positive) button
}
else{
   Toast.makeText(ActionBarMain.this,"Nothing entered", Toast.LENGTH_LONG).show();
//Prevent the user to be able to push the "PositiveButton" (Block it)
}
                        }
                    }).setNegativeButton("Cancel", null).show();
        }
        private boolean addWord(EditText title){
            String mDisplaySting = title.getText().toString();
            if(mDisplaySting.matches("")){
                Log.i(TAG,"null");
                return false;       
            }
            return true;
        }