如何强制Android的重新索引所有的照片在手机上? [英] How to force Android to re-index all the photos on the phone?

查看:358
本文介绍了如何强制Android的重新索引所有的照片在手机上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一些奇怪的与Galaxy Nexus的处理照片和文件目录的方式。我创建它们而Android(4.2.2)不知道,直到你重新启动它们的存在。嗯,至少在我的Nexus 4,我创建一个应用程序,并拍摄照片并将其存储在照片它不画廊展示,甚至出现在我的文件浏览器,当你将手机连接到计算机时。但在手机上使用文件资源管理器时,它发现它。当我重新启动我的手机也出现。这是针对普通的Andr​​oid?我提出这个假设,因为它不会发生在我朋友的Galaxy S3。所以导致我的实际问题,是有没有办法强制Android的重新索引文件以更新的信息,无需重新启动?

I noticed something odd with the way Galaxy Nexus handles photos and file directories. I create them but Android (4.2.2) does not know they exist until you reboot. Well at least on my Nexus 4. I am creating an app and when taking a photo and storing it in Pictures it does not show on Gallery or even show up on my file explorer when you connect your phone to the computer. But when using a file explorer on the phone it finds it. When I reboot my phone it also appears. Is this specific to stock Android? I am making this assumption as it does not happen on my friend's Galaxy S3. So leading to my actual question, is there a way to force Android to re-index the files to update the info without rebooting?

推荐答案

添加此code照片保存在SD廊后..

add this code after save photos in SD gallery..

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

这篇关于如何强制Android的重新索引所有的照片在手机上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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