I have an edittext which I am moving vertically when the user drags it with his finger. However I don't want that the keyboard opens when I lift the finger off the view after dragging.
How can I do this? Here is my code so far:
case MotionEvent.ACTION_MOVE:
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
v.animate().y(event.getRawY() + dY).setDuration(0).start();
break;
This will hide the keyboard:
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.