Note that there are some explanatory texts on larger screens.

plurals
  1. POAutoCompleteTextView doesn't show dropdown when I press space after typing a complete word
    primarykey
    data
    text
    <p>My main activity code:</p> <pre><code>// here you put all your data. String[] dataArray = { "Amit sharma Kumar", "Hisham Kumar Munner", "Vineet John Chaturvedi", "Lucky Kumar Verma" }; ArrayList&lt;String&gt; alAutoCompleteList; AutoCompleteTextView acTV; ArrayAdapter&lt;String&gt; adapter1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // etAuto = (EditText) findViewById(R.id.etAuto); acTV = (AutoCompleteTextView) findViewById(R.id.acTV); // Arraylist alAutoCompleteList = new ArrayList&lt;String&gt;(); adapter1 = new ArrayAdapter&lt;String&gt;(MainActivity.this, android.R.layout.simple_dropdown_item_1line, alAutoCompleteList); acTV.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub if (acTV.enoughToFilter()) { acTV.showDropDown(); acTV.bringToFront(); } } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub alAutoCompleteList.clear(); } @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub String acText = acTV.getText().toString().trim(); for (String item : dataArray) { if (item.toLowerCase().contains(acText.toLowerCase())) { alAutoCompleteList.add(item); } } acTV.setThreshold(4); acTV.setAdapter(adapter1); acTV.showDropDown(); } }); </code></pre> <hr> <p>When I search for "sharma" and press a space after that the suggestions go off. I want those suggestions to stay there. I have tried to do everything but didn't got any success. Can someone please help?</p> <p>Edit: Can someone please try this code on their emulators? Just add a <code>AutoCompleteTextView</code> in xml and run it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload