关闭软键盘方法无效时,解决思路:
通过点击键盘上的收回按钮或者返回键来关闭键盘
此种方法为模拟点击返回键,此方法只能在子线程中执行。
new Thread(){
@Override
public void run() {
Instrumentation instrumentation = new Instrumentation();
instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
}
}.start();