Recently the use of dialog Pop-up dialog box function, pop-up after entering the password, this thought this is a very simple problem, but do a good job to find EditText can not recall input method.
Solution, I also found Baidu. Record it for next use:
final Dialog alertdialog = new Dialog (this ,r.style.customdialogstyle); Alertdialog.show (); Window window = Alertdialog.getwindow (); Window.setbackgrounddrawable ( new colordrawable (0)); // Window.setcontentview ( R.layout.dialog_info); final EditText pwd = (EditText) Window.findviewbyid (R.ID.PWD); Button confirm = = (Button) Window.findviewbyid (R.id.btn_cancel);
Below is the BTN monitoring ... Omit
Above create a dialog box, use a style as follows Customdialogstyle:
<stylename= "Customdialogstyle"Parent= "@android: Style/theme.dialog"> <Itemname= "Android:windowframe">@null</Item> <Itemname= "Android:windowisfloating">True</Item> <Itemname= "Android:windowistranslucent">True</Item> <Itemname= "Android:windownotitle">True</Item> <Itemname= "Android:background">@android: Color/transparent</Item> <Itemname= "Android:windowbackground">@android: Color/transparent</Item> <Itemname= "android:backgrounddimenabled">True</Item> <Itemname= "Android:backgrounddimamount">0.6</Item> </style>
dialog box layout is very simple, I omitted, writing is also more ugly, inside a EditText, 2 button
There is also a way to create a dialog box:
Final Alertdialog Alertdialog = new Alertdialog.builder (this). Create ();
This is also a way I often use, generally I used to display some information, do not enter content. Last one, though it's ugly.
android-dialog box pops EditText cannot bring up IME