Can i create a dialog box without negative or positive buttons. That destroys it self after specific action?
AlertDialog.Builder dialog_detect= new AlertDialog.Builder(MainActivity.this);
dialog.setTitle("Detecting.....");
dialog.setMessage("Please Wait");
dialog.show();
You can do this very easily. AlertDialog. Builder alertDialogBuilder = new AlertDialog. Builder(context); // set title alertDialogBuilder.
setTitle(CharSequence title)AlertDialog alertDialog = alertDialogBuilder. create(); alertDialog. show(); This will create the alert dialog and will show it on the screen.
You can do this very easily.
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
// set title
alertDialogBuilder.setTitle("Your Title");
// set dialog message
alertDialogBuilder.setMessage("Message here!").setCancelable(false);
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
// After some action
alertDialog.dismiss();
If you have a reference to the AlertDialog
somewhere else, you can still call alertDialog.dismiss()
. This closes the dialog.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With