[ 안드로이드 스튜디오 ] 키보드 사라지게 하기 (View 가 있을때 없을때 )


[ 안드로이드 스튜디오 ] 키보드 사라지게 하기 (View 가 있을때 없을때 )

View의 값이 존재하는 경우 ex) public void onClick (View v ){InputMethodManager inputManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);inputManager.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);View의 값이 존재하지 않는 경우View view = getCurrentFocus();if (view != null) {InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);inputManager.hideSoftInputFromWindow( view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS );}...



원문링크 : [ 안드로이드 스튜디오 ] 키보드 사라지게 하기 (View 가 있을때 없을때 )