Android,表上的内容提供商删除方法不起作用
我正在尝试从服务器下载一些数据:产品列表和关联图标。这两个是在两个不同的服务 在类RPCS.java{产品列表}中,我有:Android,表上的内容提供商删除方法不起作用,android,android-contentprovider,Android,Android Contentprovider,我正在尝试从服务器下载一些数据:产品列表和关联图标。这两个是在两个不同的服务 在类RPCS.java{产品列表}中,我有: public void importPCR() { final List<PriceCollectRow> priceCollectRows = mWebServices.getPriceCollectRows(mApplicationProperties.getProperty("store_id")); final ContentValues
public void importPCR() {
final List<PriceCollectRow> priceCollectRows = mWebServices.getPriceCollectRows(mApplicationProperties.getProperty("store_id"));
final ContentValues[] pcrAsContentValues = pcrToContentValues(priceCollectRows);
int k = mContext.getContentResolver().delete(PriceCollectRowContract.CONTENT_URI, null, null);
mContext.getContentResolver().bulkInsert(PriceCollectRowContract.CONTENT_URI, pcrAsContentValues);
}
这项工作很好,k=35
在RIS.java{icons}中:
public void download() {
List<Integer> artList = new ArrayList<>();
artList.add(101640);
final List<Image> images = mWebServices.getImages(artList);
final ContentValues[] imagesAsContentValues = imagesToContentValues(images);
int m = mContext.getContentResolver().delete(ImageContract.CONTENT_URI, null, null);
int l = mContext.getContentResolver().bulkInsert(ImageContract.CONTENT_URI, imagesAsContentValues);
}
m=0不起作用,l=1
所以,这两个是非常相似的,但只有一个工作
你知道为什么吗
编辑:
发现:我没有在我的ImageProvider noob中实现delete方法多亏了Zozelfeffo,我必须在我的ImageProvider中实现delete方法发布你的contentprovider类好主意,解决方案在我的Provider中