I'm sorry to ask about what seems to be a simple problem but I've been looking for a solution for hours and now I can't stand it anymore.
My app is very simple. I've got "tasks" in a SQLite db, and I populate a listView with this db like this :
_dataAdapter = new TaskAdapter(_c, _taskDAO.getTasks());
_listTask.setAdapter(_dataAdapter);
which returns an arrayList of Task.
Problem is, when I click the dialog to remove a task, it removes it from the db but it's still on the screen, that's why I need to refresh the listView.
case DialogInterface.BUTTON_NEUTRAL:
_taskDAO.removeTask(1);
_dataAdapter.notifyDataSetChanged();
break;
But it does not work. I think it's due to the fact that I remove the task from the db but not from the adapter but I'm not quite sure. Anyway, if someone's got a solution ...