@Override
public int delete(@NonNull Uri uri, String selection, String[] selectionArgs) {
final SQLiteDatabase db_g = mOpenHelper_gallery.getReadableDatabase();
final SQLiteDatabase db_a = mOpenHelper_article.getReadableDatabase();
final int match = sUriMatcher.match(uri);
int rowDeleted;
if (selection == null) selection = "1";
switch (match) {
case IMAGE:
rowDeleted = db_g.delete(TABLE_NAME_GALLERY, selection, selectionArgs);
break;
case ARTICLE:
rowDeleted = db_a.delete(TABLE_NAME_ARTICLE, selection, selectionArgs);
break;
default:
throw new UnsupportedOperationException("Unknown uri: " + uri);
}
if (rowDeleted != 0) {
getContext().getContentResolver().notifyChange(uri, null);
}
return rowDeleted;
}
DataProvider.java 文件源码
java
阅读 40
收藏 0
点赞 0
评论 0
项目:Monolith
作者:
评论列表
文章目录