You can set Setinputtype (inputtype.type_null) for EditText, and the input method will not pop up. When needed, set the Inputtyep dynamically.
If a load activity can be used GetWindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Hide the Input method, you do not have to judge the focus. O (∩_∩) o
If you want to get to the focus of the hidden input method, you can try (I did not try, but in the project code to see. On the record)
Hide Phone keyboard
private void Hideim (View EDT) {
try {
Inputmethodmanager im = (inputmethodmanager) getsystemservice (Activity.input_method_service);
IBinder Windowtoken = Edt.getwindowtoken ();
if (Windowtoken! = null) {
Im.hidesoftinputfromwindow (Windowtoken, 0);
}
} catch (Exception e) {
}
}
When setting Onfocuschangelistener, you can call this
Kaishiriqi.setonfocuschangelistener (New View.onfocuschangelistener () {
public void Onfocuschange (View V, Boolean hasfocus) {
if (Hasfocus = = True) {
Timeflag = 0;
Hideim (v);
ShowDialog (0);
}
}
});
There are a lot of ways to do this first. Welcome to add ....
Android Hidden Input Method