在手机卡上找到个文件夹:Android\data\com.cooliris.media\cache\hires-image-cache,
这里竟然能找到以前所有被删除掉的照片,这时什么情况?
而且其文件名都是数字,请问原文件名与这个文件夹里对应的文件名如果联系起来?
如果能有办法联系起来,就可以用代码来删除里面对应的文件了。
我也不会,帮你顶一下吧

解决方案 »

  1.   

    有缓存。 缓存的是图片缩略图public static final class Images {
            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";
            }
      

  2.   

         /**
                 * The mini thumb id.
                 * <P>Type: INTEGER</P>
                 */
                public static final String MINI_THUMB_MAGIC = "mini_thumb_magic";这个就是你要删除的缓存。
      

  3.   

    用ContentResolver查询,删除应该也可以。
      

  4.   

    查了,照片的mini_thumb_magic的值在Android\data\com.cooliris.media\cache\hires-image-cache目录中找不到对应的文件!
      

  5.   

    查询demo如下,删除应该类似:
        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();
            }
        }
      

  6.   

            final int indexOfData = imageCursor.getColumnIndex(MediaStore.Images.Media.DATA);
    ...
            String data = imageCursor.getString(indexOfData);这个是你要删的文件路径。