public void setShowIME(boolean showIME) {
Class cls = EditText.class;
Method method;
try {
method = cls.getMethod(“setShowSoftInputOnFocus”, boolean.class);
method.setAccessible(!showIME);
method.invoke(mYEditText, showIME);
} catch (Exception e) {
e.printStackTrace();
}
}
采用反射的方式 传入false 即可实现
改天分析下原理