简体   繁体   English

如何使用 android “Cooliris” 库加快图像查看速度?

[英]How to speed up image viewing with android “Cooliris” gallery?

I'm running 2.3 on a Nexus S (but writing code against 2.2), and it takes forever for an image to display in the default cooliris gallery.我在 Nexus S 上运行 2.3(但针对 2.2 编写代码),并且图像需要永远显示在默认的 cooliris 库中。 This is how I am attempting to display an image:这就是我尝试显示图像的方式:

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);

In the end, it takes 5-10 seconds for the gallery to go from a black screen to showing my image which is absurdly long and makes me think I'm doing something wrong.最后,从黑屏到 go 的画廊需要 5 到 10 秒才能显示我的图像,该图像长得离谱,让我觉得我做错了什么。 Is there a better way to display an image in the gallery without requiring a different gallery be installed?有没有更好的方法在画廊中显示图像而无需安装不同的画廊?

You can add new images to the media index as you acquire them, which may may reduce the startup time of the gallery application.您可以在获取新图像时将它们添加到媒体索引中,这可能会减少图库应用程序的启动时间。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM