본문 바로가기

안드로이드 - InputMethodManager '키보드 제어'

KeyBoard 키보드

    - 'Soft KeyBoard / Hardware KeyBoard', 키보드로 구분 

    - 'Soft KeyBoard', 화면에 나오는 가상의 키보드  'InputMethodManager'로 Control 가능

 

IMM, 'InputMethodManager'

    - IMM은 생성자로 객체 구현 불가

    - SystemService로 구현이 가능

 

 InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);

 

    - 키보드 보이기

imm.toggleSoftInput(InputMethodManager.RESULT_SHOWN, InputMethodManager.RESULT_SHOWN);

 

    - 키보드 숨기기

imm.hideSoftInputFromWindow(view.getWindowToken(), 0);