我正在尝试找到一种在删除某些行时通知依赖组件的方法,那么我可以发出选择查询,获取游标,然后发出删除还是会修改原始游标?有更好的方法吗?这就是我所指的:
Cursor c = builder.query(db, projection, selection, selectionArgs, groupBy, having, sortOrder);
db.delete(table, selection, selectionArgs);
while (cursor != null && cursor.moveToNext()) {
final String name = cursor.getString(0);
// send notifications
}
c.close();