Yes, setImageViewResource sets the "android:src" image, not the background
image. The docs are quite clear about this.

For the background image, you want to call setBackgroundResource via
RemoteViews.setInt, but I'm not sure since which API level it's possible.
It's definitely in 2.2, and not in 1.6.

You can always use two ImageViews (or more) layered one over another,
instead of changing the background.

-- Kostya


2011/6/17 Jona medicalsou...@gmail.com
>
>
> <https://lh4.googleusercontent.com/-eKfgw6psc-w/TfuV9qta1GI/AAAAAAAAAA4/NZkwGZ5EFy8/device-2011-06-17-135746.png>
> After a lot of testing this is what I found out.  The widget did not get
> confused about picking up the correct image, the problem was actually the
> image got shifted to the side so it seemed like it was using the wrong image
> but it wasn't.  Since the two images land and port are a bit different in
> dimensions that is causing the ImageButton to go crazzy.  See the attached
> image and also the two sample images I use. I'm not sure why there are now
> two images. It seems like setImageViewResource doesn't update the background
> image but the source image.
>
>  --
> 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
>

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