Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>private String mclientName; </code></pre> <blockquote> <p>Put the code in oncreate()</p> </blockquote> <pre><code>mClientName=new ArrayList&lt;String&gt;(); mClientName.add("abc"); mClientName.add("abc"); mClientName.add("abc"); mClientName.add("abc"); mClientName.add("abc"); ((AutoCompleteTextView)findViewById(R.id.etschoolname)).setText(mcollegeName .equalsIgnoreCase("") ? "" : mcollegeName); ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(UserEditEducationActivity.this, android.R.layout.simple_dropdown_item_1line,mClientName); ((AutoCompleteTextView)findViewById(R.id.etschoolname)).setThreshold(1); ((AutoCompleteTextView)findViewById(R.id.etschoolname)).setAdapter(adapter); ((AutoCompleteTextView)findViewById(R.id.etschoolname)).setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub Toast.makeText(getApplicationContext(),(CharSequence)arg0.getItemAtPosition(arg2), Toast.LENGTH_LONG).show(); } }); </code></pre> <p>**</p> <blockquote> <p>and xml</p> </blockquote> <p>**</p> <pre><code>&lt;AutoCompleteTextView android:id="@+id/etschoolname" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/header" android:layout_margin="10dip" android:hint="" android:singleLine="true" android:includeFontPadding="false" android:maxLength="120" android:paddingBottom="-10dip" /&gt; </code></pre>
 

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