title: Android getting strings from sqlite database to autocompletetextview
body: <p>I am working on a sqlite database project on android. And it's my first sqlite project. I read lots of article and created my app but there's a problem that I can't  find a way to solve it. I hope you can show a way for me. 
  The problem is when I call activity by clicking a button, the device fire up a message ("unfortunately app stopped"). </p>
  
  <p>I am trying to get strings from sqlite database to autocompletetextview. </p>
  
  <p>Sqlite databasehelper class's codes</p>
  
  <pre><code>package com.example.matik;
  
  import android.content.Context;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteDatabase.CursorFactory;
  import android.database.sqlite.SQLiteOpenHelper;
  
  public class Veritabani extends SQLiteOpenHelper {
  
          private static final String VERITABANI="KAYISGDATA.db";
          private static final int SURUM=1;
  
           public static final String TABLE_TODO = "nace";
           public static final String COLUMN_ID = "_id";
           public static final String COLUMN_CATEGORY = "KOD";
           public static final String COLUMN_SUMMARY = "ACK";
           public static final String COLUMN_DESCRIPTION = "TEH";
  
           private static final String DB_DROP = "DROP TABLE IF EXISTS nace";
           private static final String DATABASE_CREATE = "create table " 
                    + TABLE_TODO
                    + "(" 
                    + COLUMN_ID + " integer primary key autoincrement, " 
                    + COLUMN_CATEGORY + " text not null, " 
                    + COLUMN_SUMMARY + " text not null," 
                    + COLUMN_DESCRIPTION
                    + " text not null" 
                    + ");";
  
      public Veritabani(Context con, String name, CursorFactory factory,
              int version) {
          super(con, VERITABANI, null, SURUM);
          // TODO Auto-generated constructor stub
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
          // TODO Auto-generated method stub
          db.execSQL(DATABASE_CREATE);
          db.execSQL("INSERT INTO nace (KOD,ACK,TEH) VALUES('01.11.07','Baklagillerin yetiştirilmesi','Tehlikeli')");}
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          db.execSQL(DB_DROP);
          onCreate(db);
      }
  
  
  }
  </code></pre>
  
  <p>Activity Class's codes</p>
  
  <pre><code>package com.example.matik;
  import java.util.ArrayList;
  
  import android.app.Activity;
  import android.database.Cursor;
  import android.database.sqlite.SQLiteDatabase;
  import android.os.Bundle;
  import android.widget.ArrayAdapter;
  import android.widget.AutoCompleteTextView;
  import android.widget.EditText;
  
  public class Matik extends Activity {
       AutoCompleteTextView auto;
       EditText nc;
       EditText th;
       Veritabani VB;
       private ArrayAdapter&lt;String&gt; arrayAdapter;
       ArrayList&lt;String&gt; Liste = new ArrayList&lt;String&gt;();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_matik);
          Liste = new ArrayList&lt;String&gt;();
          doldur();
          nc = (EditText) findViewById(R.id.editText2);
          th = (EditText) findViewById(R.id.editText3);
          auto = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1);
          arrayAdapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.select_dialog_item, Liste);
          auto.setThreshold(1);
          auto.setAdapter(arrayAdapter);
      }
  
      private void doldur() {
          SQLiteDatabase Db = VB.getReadableDatabase();
          Cursor c = Db.rawQuery("Select ACT From nace", null);
          Db.isOpen();
          while(c.moveToNext()){
              Liste.add(c.getString(c.getColumnIndex("ACT")));
          };
  
  
      }
  
  }
  </code></pre>