Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android中的AutoCompleteTextView和输入类型_Android - Fatal编程技术网

Android中的AutoCompleteTextView和输入类型

Android中的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指定inputtype为“TextUri”时,键盘会显示出来,在输入url后,当我单击“完成”时,它仍会显示在屏幕上,而不是消失

要隐藏键盘,我需要按backbutton

    <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);