在手机卡上找到个文件夹:Android\data\com.cooliris.media\cache\hires-image-cache,
这里竟然能找到以前所有被删除掉的照片,这时什么情况?
而且其文件名都是数字,请问原文件名与这个文件夹里对应的文件名如果联系起来?
如果能有办法联系起来,就可以用代码来删除里面对应的文件了。
我也不会,帮你顶一下吧
这里竟然能找到以前所有被删除掉的照片,这时什么情况?
而且其文件名都是数字,请问原文件名与这个文件夹里对应的文件名如果联系起来?
如果能有办法联系起来,就可以用代码来删除里面对应的文件了。
我也不会,帮你顶一下吧
解决方案 »
- 关于Fragment的切换状态保存问题
- Android SDK Manager 更新速度极慢
- 在长时间休眠状态下,如何保持tcp连接。有办法吗?
- 怎样判断一个点在矩形内?
- videoview控制视频的播放速度
- 在安装ADT时候出错!
- 求助资料~~~
- Android 视图报: java.lang.NullPointerException Exception details are logged in ...
- ListView嵌套问题
- android 图片按控件的大小等比例缩放的问题,路过的大神们帮帮忙。
- android里面怎么在一张表中查询出2条字段数据交叉
- 百度云推送服务出现ClassNotFound异常是什么情况
public interface ImageColumns extends MediaColumns {
/**
* The description of the image
* <P>Type: TEXT</P>
*/
public static final String DESCRIPTION = "description"; /**
* The picasa id of the image
* <P>Type: TEXT</P>
*/
public static final String PICASA_ID = "picasa_id"; /**
* Whether the video should be published as public or private
* <P>Type: INTEGER</P>
*/
public static final String IS_PRIVATE = "isprivate"; /**
* The latitude where the image was captured.
* <P>Type: DOUBLE</P>
*/
public static final String LATITUDE = "latitude"; /**
* The longitude where the image was captured.
* <P>Type: DOUBLE</P>
*/
public static final String LONGITUDE = "longitude"; /**
* The date & time that the image was taken in units
* of milliseconds since jan 1, 1970.
* <P>Type: INTEGER</P>
*/
public static final String DATE_TAKEN = "datetaken"; /**
* The orientation for the image expressed as degrees.
* Only degrees 0, 90, 180, 270 will work.
* <P>Type: INTEGER</P>
*/
public static final String ORIENTATION = "orientation"; /**
* The mini thumb id.
* <P>Type: INTEGER</P>
*/
public static final String MINI_THUMB_MAGIC = "mini_thumb_magic"; /**
* The bucket id of the image. This is a read-only property that
* is automatically computed from the DATA column.
* <P>Type: TEXT</P>
*/
public static final String BUCKET_ID = "bucket_id"; /**
* The bucket display name of the image. This is a read-only property that
* is automatically computed from the DATA column.
* <P>Type: TEXT</P>
*/
public static final String BUCKET_DISPLAY_NAME = "bucket_display_name";
}
* The mini thumb id.
* <P>Type: INTEGER</P>
*/
public static final String MINI_THUMB_MAGIC = "mini_thumb_magic";这个就是你要删除的缓存。
private void retrieveByUri(final Context context, Uri uri, final HashMap<String, ArrayList<String>> result,
final HashMap<String, String> bucketIdToName, final boolean initialScan) {
String pictureCols[] = { MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA,
MediaStore.Images.Media.BUCKET_ID, MediaStore.Images.Media.BUCKET_DISPLAY_NAME };
Cursor imageCursor = context.getContentResolver().query(uri, pictureCols,
null, null, null); if (imageCursor == null) {
// this really happens!
return;
} if (!imageCursor.moveToFirst()) {
imageCursor.close();
return;
} if (imageCursor.getColumnCount() != pictureCols.length) {
log("cursor columns not expected.");
} final int indexOfData = imageCursor.getColumnIndex(MediaStore.Images.Media.DATA);
final int indexOfBucketId = imageCursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID);
final int indexOfBucketDisplayName = imageCursor.getColumnIndex(MediaStore.Images.Media.BUCKET_DISPLAY_NAME); try {
do {
String data = imageCursor.getString(indexOfData);
String bucketId = imageCursor.getString(indexOfBucketId);
String displayName = imageCursor.getString(indexOfBucketDisplayName); if (!bucketIdToName.containsKey(bucketId)) {
bucketIdToName.put(bucketId, displayName);
} ArrayList<String> values = result.get(bucketId);
if (values == null) {
values = new ArrayList<String>();
result.put(bucketId, values);
}
values.add(data);
} while (imageCursor.moveToNext());
} finally {
imageCursor.close();
}
}
...
String data = imageCursor.getString(indexOfData);这个是你要删的文件路径。