1
I’m using elements of the type Autocomplete in the project, so that when the user type part of the text they search, it presents the suggested options for the same.
For this, I am using the following excerpt:
private void arrayAutoComplete() {
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_expandable_list_item_1, produto);
AutoCompleteTextView textView = (AutoCompleteTextView)
findViewById(R.id.editProduto);
textView.setAdapter(adapter);
}
private static final String[] produto = new String[]{
"Skol beats sensations", "Brahma", "Skol litrão", "Heinekein", "Skol 350 ml"
};
I want to know, how do I hide the smartphone keyboard when the user selects one of the suggested texts.