I am working on the same thing.

AppWidget layout can only be updated at runtime through a RemoteViews
object.  The RemoteViews object only supports limited changes to
layout.

It seems that the background property is one thing that cannot be
updated through RemoteViews.

My solution to this has been to create multiple layouts and to choose
the appropriate one when the widget is created.  Of course, this means
that the background cannot be changed without removing and re-adding a
widget.  I do not think there is any way around this.

On Oct 23, 6:10 pm, farble1670 <[email protected]> wrote:
> i'm trying to define a theme for an appwidget, and have it applied at
> the application level. i have a theme like,
>
> <style name="theme.dark">
>   <item name="android"background">#000000</item>
> </style>
>
> in my manifest, i set android:theme="@style/theme.dark". however, when
> i run the appwidget, it does not pick up the items from the style.
>
> i tried setting style="@style/theme.dark" on an individual element in
> my view layout, and that does work ... but that's not what i want. i
> don't want to call out a specific style="..." for each element in my
> view. this page,
>
> http://www.androidengineer.com/2010/06/using-themes-in-android-applic...
>
> has an excellent example app for using themes / styles, and it works
> perfectly. the only difference is that it's an application .. and it's
> setting the theme on the activity, not the application.
>
> i've also tried setting the theme at programmatically on the Context
> object in onHandleUpdate() of the appwidget, before the view is
> accessed. that doesn't work either.
>
> any ideas?
> thanks.

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