title: Linking SQLite to Autocomplete TextView in Android?
body: <p>Hello i am new to Android. I wanted to link my database to auto complete text view. I can see the scroll down list and i am able to select my text from that. but the getText() method i used to retrieve the selected text is not working. I am getting only what i typed in the text box and so i am not able to retrieve from database.please help me..snippet of my code given</p>
  
  <pre><code>ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, getAllCountries());
          final AutoCompleteTextView input_text = (AutoCompleteTextView)findViewById(R.id.Language);
           input_text.setAdapter(adapter);
          Linkify.addLinks(input_text, Linkify.ALL);
          Button button1=(Button)findViewById(R.id.button1);
          final Editable name1=input_text.getText();
  
  .
  .
  .
  public String[] getAllCountries()
      {  
           Cursor cursor = db.rawQuery("SELECT * FROM colors ",null);
  
                  if(cursor.getCount() &gt;0)
          {
              String[] str = new String[cursor.getCount()];
              int i = 0;
  
              while (cursor.moveToNext())
              {
                   str[i] = cursor.getString(cursor.getColumnIndex("English"));
                   i++;
               }
              return str;
  
          }
          else
          {
              return new String[] {};
          }
                 }
  </code></pre>