Sunday, April 17, 2011

[android-developers] Re: How to change Application theme

Thanks NJ

On Apr 16, 6:21 am, Nicholas Johnson <metthejohn...@gmail.com> wrote:
> Set your theme at run time in the onCreate() method using setTheme(int). Check
> it out here<http://developer.android.com/reference/android/view/ContextThemeWrapp...)>
> .
>
> I do this with my app, and it works very well. My onCreate() method looks
> something like this:
>
> public onCreate(Bundle b) {
>
>     /* Get your preference here */
>
>     /* Set the theme before calling setContentView() */
>     switch (theme) {
>     case X:
>         setTheme(R.style.theme1);
>         break;
>     case Y:
>         setTheme(R.style.theme2);
>         break;
>     }
>
>     super.onCreate();
>     setContentView(R.layout.layout_name);
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate