title: Android AutoCompleteTextView onClick problem
body: <p>I've created an <code>AutoCompleteTextView</code> to search through a list of course titles (obtained from an sqlite db) and what I want to do is, when the user clicks on a title from the drop-down menu, the whole information from the database about his selection appears in a text view created below the <code>AutoCompleteTextView</code>.</p>
  
  <p>I am pretty new to programming, especially for android and I would really appreciate it if someone could explain me how exactly to use <code>setOnItemClickListener</code> to call an instance in the database in the <code>TextView</code> below.</p>
  
  <p>The code for the layout (R.layout.main_courses) is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content"
      android:padding="5dp"&gt;
  &lt;AutoCompleteTextView 
   android:id="@+id/autocomplete_course"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:hint="Search for a course"/&gt;
  &lt;TextView
   android:id="@+id/text"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_below="@id/autocomplete_course"
      android:hint="Information about the course will appear here" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>and the code for the AutoCompleteTextView I've written so far is:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.main_courses);
      DataBase db = new DataBase(this.getApplicationContext());
   db.openDataBase();
   ArrayList&lt;String&gt; aCourses = db.getCoursesArr();
   db.close();
  
  
   AutoCompleteTextView search = (AutoCompleteTextView) findViewById(R.id.autocomplete_course);
   ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_courses, aCourses);
   search.setAdapter(adapter);
  }
  </code></pre>