Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to extend AutoCompleteTextView, </p> <blockquote> <p>"When threshold is less than or equals 0, a threshold of 1 is applied.".</p> </blockquote> <p><a href="http://developer.android.com/reference/android/widget/AutoCompleteTextView.html#setThreshold%28int%29" rel="noreferrer">setThreshold</a></p> <pre><code>import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; import android.widget.AutoCompleteTextView; public class InstantAutoComplete extends AutoCompleteTextView { public InstantAutoComplete(Context context) { super(context); } public InstantAutoComplete(Context arg0, AttributeSet arg1) { super(arg0, arg1); } public InstantAutoComplete(Context arg0, AttributeSet arg1, int arg2) { super(arg0, arg1, arg2); } @Override public boolean enoughToFilter() { return true; } @Override protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(focused, direction, previouslyFocusedRect); if (focused) { performFiltering(getText(), 0); } } } </code></pre> <p>in xml </p> <pre><code>&lt;AutoCompleteTextView ... /&gt; to &lt;your.namespace.InstantAutoComplete ... /&gt; </code></pre> <p>EDIT 1</p> <p>Create new class named InstantAutoComplete then put this code into the class. </p> <p>In your layout xml use this class like </p> <p>then find this widget in your actity (onCreate method).</p> <p><a href="https://stackoverflow.com/questions/9477336/how-to-make-custom-textview">Look at this example</a></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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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