Bump. I have the same question. Right now, I'm using the code below.
There's got to be a simpler way.
private void updateListview() {
// Close the old Cursor
if(mCursorAdapter != null) {
Cursor c = mCursorAdapter.getCursor();
c.close();
}
// Create the new Cursor.
Cursor c = this.queryAllUsernames();
mCursorAdapter = new SimpleCursorAdapter(this,
R.layout.singleitem_row, c, FROM_COLUMNS, TO_VIEWS);
setListAdapter( mCursorAdapter );
}
On Oct 15, 10:09 pm, jax <[email protected]> wrote:
> I have a CursorAdapter attached to a ListView
>
> I then delete a row from the database by using acontextmenuand call
> notifyDataSetChanged() on the adapter.
>
> The problem is that the ListView does not update until I quit the
> activity and re-enter.
>
> What am I doing wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---