2011-02-27 34 views
2

基本上即时尝试刷新sd卡为了让图像缩略图代表其相应的图片。原因是用户可以将图片发送到服务器,服务器对其执行图像处理,然后将其返回。它首次出现在画廊中。然而,后续请求导致第一个缩略图始终用于新图像。新图像总是覆盖旧图像(按设计),但缩略图保持不变。android,刷新图像缩略图或sd卡在调用意图选择图像之前

目前我尝试这个刷新SD卡

sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, 
        Uri.parse("file://"+ Environment.getExternalStorageDirectory()))); 

它不但是工作。基于我的实现下面有无论如何,我可以刷新SD卡在选择图像意图开始之前?

//if the user selects the file browser 
    //open the file browser and present the available images 
    if(v == choose){ 

     //refresh the sd card before viewing the images 
     sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, 
       Uri.parse("file://"+ Environment.getExternalStorageDirectory()))); 

     startActivityForResult(new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), SELECT_IMAGE); 

编辑:我也试过这种http://www.mail-archive.com/[email protected]/msg24164.html但无济于事

编辑2:我也试图保存新,但之前删除的文件,它没有用缩略图仅仅停留在同一

编辑3:我使用的设备是一个HTC英雄,我也尝试过使用LG gt540,并且问题没有发生,因为缩略图刷新时没有刷新,这让我相信它可能是一个有htc实现的bug。有没有其他人经历过这个?

回答

2

为了刷新大拇指只需重命名文件所在的文件夹