title: How to get saved value in sqlite database to list in Android?
body: <p>I am trying to get saved values in a list. I am creating anotepad and I want when anybody open notepad every saved list display on homepage in a list.</p>
  
  <p>I have successfully saved the value in a database but when I am trying to get a value in a list it is giving full string value like this "com.todo.task.activity@4106a690" in every single row.</p>
  
  <p>I think problem is in my database getlist() method please check:</p>
  
  <pre><code> public List&lt;TaskDetailsActivity&gt; GetAddTaskLists() {
       List&lt;TaskDetailsActivity&gt; TaskLists = new ArrayList&lt;TaskDetailsActivity&gt;();
  
       // Select All Query
       String selectQuery = "SELECT  * FROM " + TABLE_TASKLISTS;
       SQLiteDatabase db = this.getWritableDatabase();
       Cursor cursor = db.rawQuery(selectQuery, null);
  
       // looping through all rows and adding to list
       if (cursor.moveToFirst()) {
           do {
               TaskDetailsActivity tasks = new TaskDetailsActivity();
               tasks.settaskLists_ID(cursor.getString(0));
               tasks.settasklists_Title(cursor.getString(1));
  
               // Adding Doc to list
               TaskLists.add(tasks);
           } while (cursor.moveToNext());
       }
  
      // return Doc list
       return TaskLists;      
      }
  </code></pre>
  
  <p>Here I am calling database method like this:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      ListView list_tasklistname = (ListView)findViewById(R.id.list_tasklistname);
      TaskManager_Database db = new TaskManager_Database(getApplicationContext());
      list = db.GetAddTaskLists();
      ArrayAdapter&lt;TaskDetailsActivity&gt; adapter = new ArrayAdapter&lt;TaskDetailsActivity&gt;(getApplicationContext(), 
                                                      android.R.layout.simple_list_item_1, list);
      list_tasklistname.setAdapter(adapter);
      adapter.notifyDataSetChanged();
  </code></pre>
  
  <p>Please let me know what is the error. Thanks</p>