Show dialog after every defined android value
is it possible to open a dialog in android after every certain value (provided by the user). In my application, the user can go up and down by 1 by clicking a button and what I want to do is let the user set a number for example. 45 and after every 45 numbers the user goes up or down, I want a dialog to appear.
For example, if the user wants to see a dialog after every 100 values, then 100 characters will be entered in the text box and the up and down buttons will be pressed, and when they reach the current value + 100 / - 100, the dialog will pop up. For example, after the user sets the dialog to appear after every 100 values, then a dialog will appear with numbers like 100, 200, 300, etc.
call the dialog in the buttons method. In the button method ...
AlertDialog alertDialog1 = new AlertDialog.Builder(
AlertDialogActivity.this).create();
// Setting Dialog Title
alertDialog1.setTitle("Alert Dialog");
// Setting Dialog Message
alertDialog1.setMessage(String.valueOf(your_number_variable));
// Showing Alert Message
alertDialog1.show();
source to share