AutoCompleteTextView modify for auto selected first search text with out click
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_main );
List<String> list = new ArrayList<>();
list.add( "1-Colombo" );
list.add( "2-MALIGAWATTA" );
list.add( "3-KELANITHISSA" );
list.add( "4-4-KANUWA" );
list.add( "5-THORANA-HANDIYA" );
list.add( "6-KELANIYA-UNI" );
list.add( "7-KIRIBATHGODA" );
list.add( "8-MAHARA-HANDIYA" );
list.add( "9-KADAWATHA" );
list.add( "10-GONAHENA-HANDIYA" );
AutoCompleteTextView searchAutoComplete = (AutoCompleteTextView) findViewById( R.id.start );
ArrayAdapter<String> newsAdapter = new ArrayAdapter<String>( this, android.R.layout.simple_dropdown_item_1line, list );
searchAutoComplete.setAdapter( newsAdapter );
searchAutoComplete.setThreshold( 1 );
searchAutoComplete.setOnItemClickListener( new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText( MainActivity.this, "Hi" + position, Toast.LENGTH_SHORT ).show();
}
} );
}
}
How can we modify this AutoCompleteTextView for automatically select first search value without click it.??
Any Idea