Currently I do the following:
1) database is linked to 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_VALUE
is changed every 2 seconds in the database. Then items.notifyDataSetChanged()
is called. But data on the screen is not updated (R.id.time
is TextView
currently, will be TextSwitcher
once this code works).
Database is updated with execSQL.