Search code examples
androidiconsandroid-appwidget

Get other applications icon uri?


I have an Android appwidget which shows icons of other applications on it.

I get the other applications icons with appInfo.loadIcon and then I set it to the widgets with setImageViewBitmap.

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.

Is there an accessible URI to other applications' icons?

Thanks.


Solution

  • 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.