On Thu, Sep 9, 2010 at 9:23 AM, Chister Nordvik <[email protected]> wrote:
> I have an application where I would like the users to be able to
> change the theme. Currently my layout have elements like this:
> <LinearLayout android:orientation="vertical"
>  android:layout_width="fill_parent"
> android:layout_height="fill_parent"
>  android:background="@color/background_transparency">
>
> what I would like to do is to change to a new colors.xml that has a
> different value for "@color/background_transparency"  if the user
> selects one of the themes available. Alternatively to be able to
> change the value of "@color/background_transparency" in code.
>
> Is this possible?

Resources cannot be modified at runtime.

However, there is nothing preventing you from creating a
getCustomColor() method somewhere that looks for your override value
and returns it, otherwise returning the color resource value.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://skillsmatter.com/go/os-mobile-server

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