开发者

AutoCompleteTextView and input type in Android

When I give inputtype as "TextUri" for AutoCompleteTextView, the keyboard shows up and after entering the url when I click on Done, instead of going away it's still getting displayed in the screen..

To hide the keyboard,I need to press backbutton..

    <AutoCompleteTextView android:id="@+id/autocomplete_country"
    android:la开发者_如何学编程yout_width="fill_parent"
    android:layout_height="wrap_content"
    android:inputType="textUri"/>


The answer to the link below might be helpful, it basically says use this:

InputMethodManager inputManager = (InputMethodManager) Context.getSystemService(Context.INPUT_METHOD_SERVICE); 
  inputManager.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);

how to hide keyboard after typing in EditText in android?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜