Use Loaders to ensure that all cursor operations are done asynchronously, thus eliminating the possibility of blocking the UI thread.
When using CursorAdapter don´t use notifyDataSetChanged instead use:
db.updateData();
yourCursor = db.getData();
yourAdapter.changeCursor(yourCursor);