Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Check this <a href="http://developer.android.com/reference/android/widget/AdapterView.OnItemClickListener.html" rel="nofollow">http://developer.android.com/reference/android/widget/AdapterView.OnItemClickListener.html</a></p> <blockquote> <p>Parameters</p> <p>parent The AdapterView where the click happened.</p> </blockquote> <p>arg1 is the AutoCompleteTextView (edtxInput) itself. so you can do</p> <pre><code> AutoCompleteTextView edtxInput = (AutoCompleteTextView)layout.findViewById(R.id.edtx_input); edtxInput.setThreshold(2); edtxInput.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView&lt;?&gt; parent, View arg1, int position, long arg3) { Console.debug(TAG, "view: " + arg1, Console.Liviu); AutoCompleteTextView medtxInput = (AutoCompleteTextView)parent; medtxInput.setText(((FormOption)medtxInput.getAdapter().getItem(position)).getDescription()); } }); </code></pre> <p><strong>UPDATE</strong></p> <p>Seems like the <code>AutoCompleteTextView</code> is not a subclass of AdapterView. That is at some part "fault" of the SDK here. To get the <code>AutoCompleteTextView</code> you can do a hack</p> <pre><code> AutoCompleteTextView medtxInput = (AutoCompleteTextView)view.getParent(); </code></pre> <p>So you get the clicked view then get its parent that is the <code>AutoCompleteTextView</code></p> <p>But why you don't want <code>AutoCompleteTextView</code> to be final in the first place? Any particular reason?</p> <p>If you want only the adapter you can write this and only this</p> <pre><code>((ChildClass)parent.getItemAtPosition(position)).getDescription(); </code></pre>
    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