Using a custom view in Alertdialog, if the view has EditText, click on it, the default is not to jump out of the soft keyboard, not the focus of the problem.
Solution, there are two, one is to change the Alertdialog to dialog, but so that the outermost layer of the dialog box will be more than a box, the top will be empty dozens of DP, of course, you can use Setbackgrounddrawable (new colordrawable (0)) Set the background to transparent, hide the border, but the above dozens of of the empty DP is still there, the dialog box is not centered on the screen.
Code:
New= Ad.getwindow (); window.setbackgrounddrawable (new colordrawable (0 )); Window.setcontentview (r.layout.cancel_sos_dialog);
The best way to do this is the second type:
New= Ad.getwindow (); Window.setcontentview (Managerdialoglayout_.build (Context,ad));
Call Setview (layout) before calling the Show method, and then call Window.setcontentview (layout) After show, and the two layout layouts should be the same.
As for the reason, temporarily unclear, but did solve the problem, click on the EditText, you can bring up the soft keyboard, input method.
January 6, 2013: The first method of the bug, the workaround:
Use a custom style:
<style name="Customdialogstyle"Parent="@Android: Style/theme.dialog"><item name="Android:windowframe"> @null </item><item name="android:windowisfloating">true</item><item name="android:windowistranslucent">true</item><item name="Android:windownotitle">true</item><item name="Android:background"> @android: Color/transparent</item><item name="Android:windowbackground"> @android: Color/transparent</item><item name="android:backgrounddimenabled">true</item><item name="Android:backgrounddimamount">0.6</item></style>Dialog AD=NewDialog (Context,r.style.customdialogstyle);
Android Development solves the problem that edittext in Alertdialog cannot recall input method