I have an activity (forced into protrait mode) that is required to show the default soft-keyboard. So I thought I'd set focus to the edittext when the activity is launched... so far so good.
Two issues
Looking for assistance to solve these two issues. thanks.
to solve #1
private void hideSoftKeyboard()
{
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mAutoCompleteTextView.getApplicationWindowToken(), 0);
}
private void showSoftKeyboard()
{
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,InputMethodManager.HIDE_IMPLICIT_ONLY);
}
#2 has no solution
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.