AutoComplete fixed selection?
<p>How do i have an AutoComplete selection based on alphabetic instead of fixed switch cases? The situation is, everything working except when i input keyword with "B" showing Badrul as first suggestion but when clicked it will still refer to the first switch cases which is opening up Adidas.class instead of Badrul.class</p>

<p>Please help, i am new in this. Is AutoComplete suitable for my requirement?</p>

<pre><code>public class Search extends Activity
{
    public void onCreate(Bundle savedInstanceSate)
    {
        super.onCreate(savedInstanceSate);
        setContentView(R.layout.searchshop);

        AutoCompleteTextView autoComplete = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1);
        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, shops);
        autoComplete.setAdapter(adapter); 
        autoComplete.setThreshold(1);
        autoComplete.setOnItemClickListener(new OnItemClickListener()
        {

        @Override
        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position, long arg3) 
        {
            switch(position)
            {
            case 0:
                startActivity(new Intent(Search.this, Adidas.class));
                break;
            case 1:
                startActivity(new Intent(Search.this, Affin.class));
                break;
            case 2:
                startActivity(new Intent(Search.this, AlamArt.class));
                break;
            case 3:
                startActivity(new Intent(Search.this, Badrul.class));
                break;
            }
        }
        });     
    }
    static final String[] shops = new String[]
            {
                "Adidas", "Affin Bank", "Alam Art Gallery", "Badrul"
            };
}
</code></pre>
