1。 取出底層view對click 事件,touch事件的響應
handWriteContainer.setFocusableInTouchMode(false);
2。 彈出軟鍵盤
需要注意的是彈出軟鍵盤一般需要做一定的延時,否則可能因爲activity沒有初始化完成而彈不出來的現象
Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run() {
InputMethodManager inputManager =
(InputMethodManager) employeeIdEdit.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.showSoftInput(employeeIdEdit, 0);
}
},
250);
3。 隱藏軟鍵盤
InputMethodManager imm = (InputMethodManager) ScreenShotActivity.this.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(bugDetailEdit.getWindowToken(), 0);