Article turned from: http://21jhf.iteye.com/blog/2007375;
If there is an Edit entry box in the Alertdialog (Newmainlayout the EditText control is created dynamically), the input method cannot be displayed after show
Alertdialog.builder Builder = new Alertdialog.builder (context);
Builder.settitle (Modalwindowtitle);
Builder.setview (newmainlayout);
Builder.setnegativebutton ("Return", New Dialoginterface.onclicklistener () {
@Override
public void OnClick (dialoginterface dialog, int whichbutton) {
Dialog.dismiss ();
}
});
Alertdialog ad = Builder.create ();
Ad.show ();
The following two lines of code can be added to pop-up input
Ad.getwindow (). Clearflags (WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
Ad.getwindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
Android--------Alertdialog EditText cannot eject input method to resolve