Android中的AutoCompleteTextView和输入类型
当我为AutoCompleteTextView指定inputtype为“TextUri”时,键盘会显示出来,在输入url后,当我单击“完成”时,它仍会显示在屏幕上,而不是消失 要隐藏键盘,我需要按backbuttonAndroid中的AutoCompleteTextView和输入类型,android,Android,当我为AutoCompleteTextView指定inputtype为“TextUri”时,键盘会显示出来,在输入url后,当我单击“完成”时,它仍会显示在屏幕上,而不是消失 要隐藏键盘,我需要按backbutton <AutoCompleteTextView android:id="@+id/autocomplete_country" android:layout_width="fill_parent" android:layout_height="wrap_co
<AutoCompleteTextView android:id="@+id/autocomplete_country"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textUri"/>
下面链接的答案可能会有所帮助,它基本上是说使用以下内容:
InputMethodManager inputManager = (InputMethodManager) Context.getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);