I am using a SimpleCrusorAdaptor to display a list of items in a list view. When an item in listview is selected it starts an other activity, this activity changes the puzzle status which is shown in the list view. When this activity terminates and activity containing the list view again becomes active, list view shows the old status,
How can I ensure if the activity containing list view resumes, the cursor adapter updated the values ? Some thing to be done in onResume() of the cativity ?
private static String[] FROM = { PuzzleDatabase.KEY_PUZZLE_TITLE,
PuzzleDatabase.KEY_PUZZLE_STATUS };
private static int[] TO = { R.id.puzzle_title, R.id.puzzle_status };
ListView listView = (ListView) findViewById(R.id.puzzle_list);
this.cursor = ps.puzzleDatabase.getPuzzleTitles();
// Set up data binding
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.puzzle_list_row, cursor, FROM, TO);
// Assign adapter to ListView
listView.setAdapter(adapter);
for the updating values try doing this