Programmatically:
this.getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
XML:
android:focusable="true" android:focusableInTouchMode="true" android:descendantFocusability="beforeDescendants"
Programatically 2:
public void hideSoftKeyboard(){ if(getActivity().getCurrentFocus() != null){ InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), 0); } }
Sumber http://aldokelvianto.blogspot.com
No comments:
Post a Comment