问题描述
我有一个Android appwidget这表明它的其他应用程序的图标。
I have an Android appwidget which shows icons of other applications on it.
我得到appInfo.loadIcon其他应用程序的图标,然后我将它设置为与setImageViewBitmap小部件。
I get the other applications icons with appInfo.loadIcon and then I set it to the widgets with setImageViewBitmap.
问题是,如果我有在部件上有太多图标,我碰到一个失败粘结剂交易的错误。据我所知,它的大小限制及本解决方案它使用的图像,而不是URI位图本身。
The problem is that if I have too many icons on the widget, I get "FAILED BINDER TRANSACTION" error. I understand that it's from a size limit and the solution it to use the image uri instead of the bitmap itself.
有一个可访问的URI到其他应用程序的图标?
Is there an accessible URI to other applications' icons?
感谢。
推荐答案
尝试 android.resource:// [包装] / [RES类型] / [RES名称]
,其中 [RES类型]
在你的情况是绘制
。包和名称必须来自 ResolveInfo
或你越来越您的数据。
Try android.resource://[package]/[res type]/[res name]
, where [res type]
in your case would be drawable
. The package and name would have to come from the ResolveInfo
or wherever you are getting your data.
这篇关于获取其他应用程序图标URI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!