In a widget scenario, you'd need to to push updates that contain references to your own resources as well as the icon from another package. And that's where I think there is a problem using the resId in a RemoteViews, since each package has its own resource IDs.

Have you tried using a resource Uri?

http://developer.android.com/reference/android/content/ContentResolver.html#SCHEME_ANDROID_RESOURCE

Something like this:

android.resource://the.other.apps.package.name/drawable/id_value

( not sure if you need the "drawable" in the above )

And then using it with RemoteViews.setImageViewUri.

-- Kostya

07.02.2011 14:32, b_t пишет:
No, I would like to display icons of other installed applications.

I thought that it isn't possible because a resource id is unique only
in a project
not in the whole system, am I right?

Just I don't understand what the ActivityInfo.icon or ResolveInfo.icon
is good for
if I can't use that value to display the app icon.


On Feb 7, 9:49 am, Kostya Vasilyev<kmans...@gmail.com>  wrote:
If that's your own application, sure.

If it's not, I don't see how the "remote" side of RemoteViews would know
to load some resources from your application and the icon from another
package.

-- Kostya

07.02.2011 11:44, b_t пишет:

Hi,
ActivityInfo class contains an icon attribute which is a resource id.
Can my appwidget use this resource id to display this icon?
(ResourceViews.setImageViewResource)
Or I have to load the icon and call setImageViewBitmap?
The problem with this solution that it puts more data to the
transaction.
Thanks, Tamás
--
Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to