2012-12-03 6 views
1

이 가능한 중복은 :
Close/hide the Android Soft Keyboard소프트 입력 키보드 표시되지는 안드로이드에

나는 내 자신을 가지고 기본 키보드를 숨기려면 다음 코드를 사용하고 그것을 잘

를 작동
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); 

하지만 지금 버튼을 클릭 할 때 다음을 사용하면 소프트 키보드가 다시 나타나지 않습니다. 왜?

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); 
+2

체크 http://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard 시도 – Matthieu

답변

1

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); 
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 
InputMethodManager.HIDE_IMPLICIT_ONLY);