How to use the seletedItem from the AutoCompleteTextView dropdown list?
<p>Friends, I am using AutoCompleteTextView. The Suggestion :</p>

<pre><code>String[] recipes={ "Fish", "Chicken", "Mutton"};
</code></pre>

<p>How do I do this: </p>

<p>When I select one of the item from the dropdown list, it will go to another event? </p>

<p>For example, I type <em>Fi</em>, it will come out <em>Fish</em> from the dropdown list and then I select Fish, it will go to <strong>another Activity</strong>.</p>

<pre><code>package net.learn2develop.Activities;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.AdapterView;
import android.view.View;
import android.content.Intent;

public class AutoCompleteTextActivity extends Activity {

String[] recipes ={
        "Nasi Lemak With Ikan Bilis",
        "Steamed Cod Fish"
};
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,              android.R.layout.simple_dropdown_item_1line, recipes);


    AutoCompleteTextView textView = (AutoCompleteTextView)    findViewById(R.id.txtRecipes);

    textView.setThreshold(3);
    textView.setAdapter(adapter);

    textView.setOnItemSelectedListener(new OnItemClickListener(){
        public void onItemClick(AdapterView&lt;?&gt; av, View view, int index, long id){

             Intent i=new Intent(this,Activity2.class);
             i.putExtra("item",recipes[index]);
             StartActivity(i);
        }

    });
}
</code></pre>

<p>}</p>
