视频缩略图不刷新 [英] Video thumbnails not refreshing

查看:190
本文介绍了视频缩略图不刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我显示在GridView中所有可用的视频在其上的SD卡使用以下code。

I am showing all available videos in a gridView on which are in SDCard by using following code.

String[] proj= {MediaStore.Video.Media._ID,MediaStore.Video.Media.DATA,MediaStore.Video.Media.DISPLAY_NAME,
                MediaStore.Video.Media.SIZE };
        videocursor = getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null, null, null);

这是工作的罚款......但是,如果我作出任何影片的变化(即重命名,删除)以上code不工作。这正显示出旧的内容而已,表示不清爽。我怎样才能解决这个问题。

It is working fine... But if i made any changes to videos (i.e rename, delete) above code is not working. It is showing old content only, means not refreshing. How can i solve this problem

推荐答案

什么应该做的是以下内容:

what should do is the following :

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

就在您的code之后。

right after your code .

为应用程序提供通过新创建的或下载的媒体文件的媒体扫描仪服务的一种方式。

provides a way for applications to pass a newly created or downloaded media file to the media scanner service.

这篇关于视频缩略图不刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆