Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/198.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android、刷新图像缩略图或sd卡,然后再调用意图选择图像_Android_Refresh_Android Sdcard - Fatal编程技术网

android、刷新图像缩略图或sd卡,然后再调用意图选择图像

android、刷新图像缩略图或sd卡,然后再调用意图选择图像,android,refresh,android-sdcard,Android,Refresh,Android Sdcard,基本上,我正在尝试刷新sd卡,以便让图像缩略图代表相应的图片。原因是用户可以向服务器发送图片,服务器对其执行图像处理,然后返回。它第一次出现在画廊里,正如预期的那样。但是,后续请求会导致新图像始终使用第一个缩略图。新图像总是覆盖旧图像(按设计),但缩略图保持不变 目前我正在尝试刷新sd卡 sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environme

基本上,我正在尝试刷新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 );
编辑:我也试过,但没有用

编辑2:在保存新文件之前,我也尝试过删除这些文件,但没有用,只是缩略图保持不变


编辑3:我使用的设备是htc hero,我也在lg gt540上试用过,当缩略图被覆盖时刷新,问题没有出现,这让我相信这可能是htc实现的一个错误。还有其他人经历过这种情况吗?

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