此方法是告知系统不使用系统软键盘
//初始化的时候告知系统不使用系统软键盘
EditText connect = findViewById(R.id.edit_connect);
int sdk_int = android.os.Build.VERSION.SDK_INT;
if (sdk_int <= 10) {
connect.setInputType(InputType.TYPE_NULL);
} else {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
try {
Class<EditText> cls = EditText.class;
Method setSoftInputShownOnFocus;
setSoftInputShownOnFocus = cls.getMethod("setShowSoftInputOnFocus", boolean.class);
setSoftInputShownOnFocus.setAccessible(true);
setSoftInputShownOnFocus.invoke(connect, false);
} catch (Exception e) {
e.printStackTrace();
}
}