0

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:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:inputType="textUri"/>
Shan
  • 2,822
  • 9
  • 40
  • 61

1 Answers1

1

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?

Community
  • 1
  • 1
Jack
  • 9,156
  • 4
  • 50
  • 75