You might have different images for different screen orientations, but
the names of the images are the same:

button_image_on.png
button_image_off.png

Because the names are the same the OS doesn't know which you want it
to show. Putting the images in different subfolders doesn't matter, as
the Resource file that is created for you doesn't consider those, only
the names of the items in the folders (which are set as the id). The
only way you get what you want is to change the names of the images...

Maybe you could use:

button_port_on.png
button_port_off.png
button_land_on.png
button_land_off.png

On 17 jun, 16:48, Jona <[email protected]> wrote:
> I think there is a bug somehow on the Android OS. I'm using HTC EVO which on
> the home screen it never goes to landscape as it was intended by HTC.
>
> *Here is my setup:*
>
> drawable-port/button_image_on.png
> drawable-port/button_image_off.png
> drawable-land/button_image_on.png
> drawable-land/button_image_off.png
>
> On my home screen widget I toggle the images depending on the received
> broadcast intent.
>
> This is what I use to change the image from within the AppWidgetProvider:
>
> if (toggleOn)
> {
>    views.setImageViewResource(R.id.button_image_on, 
> R.drawable.button_image_on);}
>
> else
> {
>    views.setImageViewResource(R.id.button_image_on, 
> R.drawable.button_image_off);
>
> }
>
> The problem I'm having is that some cases the land images are shown when the
> phone is in port mode.
>
> To reproduce easily from my application I send a broadcast intent to toggle
> image state on the widget. I send this intent while the app is in landscape
> mode. Than when I got to the homescreen bam! the widget in port mode is
> using a land image! Odd right?
>
> Anyone run into a similar issue?

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

Reply via email to