Tôi cố gắng để hiển thị bàn phím sau khi tôi thổi phồng LinearLayout và gọi setContentView như:Làm cách nào để buộc bàn phím hiển thị/ẩn?
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.showSoftInput(etContent, InputMethodManager.SHOW_FORCED);
getContent.requestFocus();
Nó đã không làm việc. Tôi cũng đã thử điều này:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
Nhưng nó cũng không hoạt động. Làm thế nào tôi có thể buộc bàn phím hiển thị/ẩn? Tôi đã làm gì sai?
Bản sao y của http://stackoverflow.com/questions/1109022/how-to-close-hide-the-android-soft-keyboard và http://stackoverflow.com/questions/2479504/forcing-the-soft-keyboard-open – Polynomial