我可以创建一个没有否定或肯定按钮的对话框吗?特定行动后会自我毁灭吗?
AlertDialog.Builder dialog_detect= new AlertDialog.Builder(MainActivity.this);
dialog.setTitle("Detecting.....");
dialog.setMessage("Please Wait");
dialog.show();
你可以很容易地做到这一点。
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();
如果您有参考AlertDialog
在其他地方,您仍然可以致电alertDialog.dismiss()
。这将关闭对话框。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)