full screen custom dialog on android -
recently , have custom dialog code.
i want full screen custom dialog.
how can full screen custom dialog on android
public class mainactivity extends appcompatactivity { static process rebootprocess; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); alertdialog.builder builder = new alertdialog.builder(this); builder.setcancelable(false); builder.settitle("warning~~"); builder.setmessage("reboot") .setpositivebutton("ok",new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { try { rebootprocess = runtime.getruntime().exec(new string[]{"su", "-c", "poweroff"}); } catch (ioexception e) { e.printstacktrace(); } dialog.dismiss(); } }); builder.create().show(); }
inside oncreate, create dialog
//design layout file full screen
dialog mdialog = new dialog(this); // set other paramters dialog mdialog.setcontentview(r.layout.your_layout_file);
Comments
Post a Comment