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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -