Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are different click listeners in AutoCompleteTextView.</p> <p>The first way is in the layout xml, you can define the onCLick attribute, with the function that you want to be called, in the example below, clicked. </p> <pre><code>&lt;AutoCompleteTextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/spinner" android:layout_width="match_parent" android:layout_height="wrap_content" android:onClick="clicked" /&gt; </code></pre> <p>Then, in your activity, you define the function clicked.</p> <pre><code>public void clicked(View v) { // on click do .. } </code></pre> <p>Or you can set it directly in your code:</p> <pre><code>ACTV.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { finish(); } }); </code></pre> <p>If you want to set the click listener when the user clicks in an item in the dropdown list there is another method, the <em>setOnItemClickListener</em>.</p> <pre><code>ACTV.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick (AdapterView&lt;?&gt; parent, View view, int position, long id) { //... your stuff } }) </code></pre> <p>And you have a last option, to set the click listener when the user actually selects an item in the dropdown list using <em>setOnItemSelectedListener</em>.</p> <pre><code>ACTV.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected (AdapterView&lt;?&gt; parent, View view, int position, long id) { //... your stuff } @Override public void onNothingSelected (AdapterView&lt;?&gt; parent) { //... your stuff } }) </code></pre> <p>References: </p> <p><a href="http://developer.android.com/reference/android/widget/AutoCompleteTextView.html" rel="noreferrer">http://developer.android.com/reference/android/widget/AutoCompleteTextView.html</a></p> <p>Good luck! </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