如何在 android 中将动态创建的位图设置为 livefolder 图标?

发布于 2024-09-13 17:09:33 字数 341 浏览 2 评论 0原文

如何在 android 中将动态创建的位图设置为 livefolder 图标?

LiveFolder 采用 EXTRA_LIVE_FOLDER_ICON 作为 ShortcutIconResource。有没有办法将动态创建的位图引用为快捷方式图标资源?在下面的代码段中,我想设置新创建的位图文件的文件路径,而不是使用 icon 作为 int 值。

intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON,
                 Intent.ShortcutIconResource.fromContext(context, icon));

How can I set dynamically created bitmap as livefolder icon in android?

LiveFolder takes EXTRA_LIVE_FOLDER_ICON as ShortcutIconResource. Is there a way to reference dynamically created bitmap as shortcuticonresource? In the following code segment instead of using icon as int value I would like to set the file path for the newly created bitmap file.

intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON,
                 Intent.ShortcutIconResource.fromContext(context, icon));

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

信愁 2024-09-20 17:09:33

无法使用活动文件夹中文件的位图。

It is not possible to use bitmap from a file in a live folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文