I am making a counter. On load or onCreat I want to show an input dialog box for user to input an integer value. 1st... If user doesn't enter any character value in box. Then User is not able to click Ok button. 2nd.. If user doesn't enter any value in it. Then he will not able to hit Ok or Cancle button.
Please help....!! Thanks in advance
Here is prompt box code
AlertDialog.Builder ab = new AlertDialog.Builder(TasbihWorkActivity.this);
ab.setTitle("Enter Any String");
final EditText editText = new EditText(TasbihWorkActivity.this);
ab.setView(editText);
ab.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
count_num.setText(editText.getText().toString());
}
});
ab.setNegativeButton("Cencel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
count_num.setText("No text entered!!!");
}
});
AlertDialog a = ab.create();
a.show();