android - 如何使用 android "Cooliris"画廊加快图像查看速度?

标签 android android-gallery cooliris

我在 Nexus S 上运行 2.3(但针对 2.2 编写代码),图像需要很长时间才能显示在默认的 cooliris 图库中。这就是我尝试显示图像的方式:

Uri imageIdentifier = getImageUriOnFilesystem();
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(imageIdentifier, "image/jpeg");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Activity.this.startActivity(intent);

最后,画廊从黑屏到显示我的图像需要 5-10 秒,这太长了,让我觉得我做错了什么。有没有更好的方式来显示图库中的图像而不需要安装不同的图库?

最佳答案

您可以在获取新图像时将它们添加到媒体索引,这可能会减少图库应用程序的启动时间。

Intent i = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
i.setData(imageIdentifier));
sendBroadcast(i);

关于android - 如何使用 android "Cooliris"画廊加快图像查看速度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6728159/

相关文章:

android - opencv人脸识别从数据库中为未知用户返回相同的名字

Android SupportMapFragment.getMap() 返回 null

android - Android 版 Chrome 中的网站文字更大

android - 如何拍摄照片并将其保存在图库中可见的我的应用程序的自定义文件夹中

Android Cooliris Gallery 开发者文档

java - 根据HashMap Key Value获取ArrayList Index

android - 将图库中的图像存储到不同的文件夹

Android 如何创建默认图库到圆形图库?

javascript - firefox 扩展如何在 3D 中使用整个屏幕(例如 CoolIris)?

rss - FLV视频无法在Cooliris嵌入墙中播放