Update database method in android
<p>I would like to add Task name from pop up and It automatically will add to list. So, is there any way to update database automatically. Here is my method </p>

<pre><code>SampleDB = this.openOrCreateDatabase("SampleDB", SQLiteDatabase.CREATE_IF_NECESSARY, null);
                String query = "select *from TaskList";
                Cursor c = SampleDB.rawQuery(query, null);
                c.moveToFirst();
                do{
                    String Task = c.getString(c.getColumnIndex("task"));

                    /* Add current Entry to results. */ 
                 results.add(Item);
                }while(c.moveToNext());
                 this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, results));
</code></pre>
