키보드를 숨기는 메소드
1
2
3
4
5
6
7
|
private static void hideSoftKeyboard(Activity activity) {
InputMethodManager inputMethodManager =
(InputMethodManager) activity.getSystemService(
Activity.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(
activity.getCurrentFocus().getWindowToken(), 0);
}
|
cs |
null exception 방지
1
2
|
if (This.getCurrentFocus() != null)
hideSoftKeyboard(This);
|
cs |
'개발 > Android' 카테고리의 다른 글
[Android] 라디오버튼 alertDialog (0) | 2019.12.17 |
---|---|
[Android] Android 시리얼 넘버 얻기 / get serial number (0) | 2019.12.05 |
[Android] EditText 엔터키 이벤트 (0) | 2019.12.03 |
[Android] 해쉬키 알아내기 (0) | 2019.11.06 |
[Android] "ActivityName" has leaked ServiceConnection (0) | 2019.10.28 |