I am currently doing the following:
1) the database is associated with a ListView:
String[] from = new String[]{DbAdapter.KEY_TITLE,
DbAdapter.KEY_DISPLAYED_VALUE,
DbAdapter.KEY_FAVORITE};
int[] to = new int[]{R.id.name, R.id.time, R.id.icon};
items = new SimpleCursorAdapter(this, R.layout.row, itemsCursor, from, to);
2) KEY_DISPLAYED_VALUEchanges every 2 seconds in the database. Then called items.notifyDataSetChanged(). But the data on the screen is not updated ( R.id.timeis TextViewcurrently going to be TextSwitcherafter this code).
The database is updated by execSQL .
source
share