我想从弹出窗口中添加任务名称,它会自动添加到列表中。那么,有没有办法自动更新数据库。这是我的方法
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<String>(this, android.R.layout.simple_list_item_1, results));