I have a long press option on my listview which will delete the long pressed db entry. The delete does actually work. If i come out of the app and go back in i am presented wit
After you delete the last row, the cursor returned is empty. Therefore c.moveToFirst() returns false, your whole if block is skipped, and your listview is left unchanged, still showing the just-deleted row.
It works when you delete one of several rows because moveToFirst() returns success as long as there was another row still left.
It works when you exit and resume because at that point the activity is recreated and the listview starts uninitialized.
Solution: drop the if statement completely. SimpleCursorAdapter should be happy with a cursor with 0 rows.
Long term better yet, migrate to a ContentProvider and use the ContentObserver model to make sure your cursors update themselves when the database they reflect changes.