Thank you!! moving super.onCreate did the trick! super.onCreate seems to
call getTheme which initiates it(?).




On Thu, May 21, 2009 at 9:01 PM, [email protected] <
[email protected]> wrote:

>
> You can try to put setTheme() before super.onCreate() --> your
> background will change.
>
> If you want to change your background by pressing a button, get the
> root layout object (LinearLayout, TableLayout...), and call set
> Background from Drawable, res.
>
> But I still don't know how to change the text color by pressing a
> button.
>
>
> On May 21, 2:53 pm, "[email protected]"
> <[email protected]> wrote:
> > Hi all,
> >
> > I am trying to change my application theme from java code (For ex:
> > press a button, and the whole application will apply a new Theme: new
> > background, new text color).
> >
> > But I don't know why setTheme(myCustomTheme) only apply my
> > android:textColor item, it doesn't apply the item
> > android:windowBackground. (I call setTheme() before line setContentView
> > () like many tutorials)
> >
> > Everything is fine if I do change in AndroidManifest <application
> > android:theme="@style/myCustomTheme".
> >
> > Please help me if you have any solution for my problem.
> >
> > Look forward to hearing from you!!!
> >
> > PS: myCustomTheme:
> >
> > <style name="Theme.App" parent="android:Theme">
> >         <item name="android:windowBackground">@drawable/bgbb</item>
> >         <item name="android:textColor">#ff000000</item>
> > </style>
> >
>

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