Setting theme in an activity

by Sudeep Jha » Sun, 06 Jun 2010 14:47:45 GMT


Sponsored Links
 Hi All,

This is my  themes.xml file

<resources>

<style name=*"Theme.Blue"* parent=*"android:Theme"*>

<item name=*"android:windowBackground"*>*...@drawable*/bodyimg_blue</item>

<item name=*"android:colorBackground"*>@color/*royalblue*</item>

<item name=*"android:textColor"*>@color/*midnightblue*</item>

<item name=*"android:textViewStyle"*>@style/TextViewBlue</item>

</style>
<resources>
This is main activity code snippet

*public* *void* onCreate(Bundle savedInstanceState) {

*super*.onCreate(savedInstanceState);

setTheme(R.style.Theme_Blue);

setContentView(R.layout.*main_screen*);
...
The background image is not getting loaded but the text color and
textViewStyle got changed.
The background image remains the defalult one -blank screen.
If I am setting the theme in android manifest file then it works properly.
Can anybody tell me the reason for this?

Warm Regards,
Sudeep

--



Setting theme in an activity

by Sudeep Jha » Sun, 06 Jun 2010 16:55:47 GMT


 Hi All,

This is my  themes.xml file

<
resources>

<style name=*"Theme.Blue"* parent=*"android:Theme"*>

<item name=*"android:windowBackground"*>*...@drawable*/bodyimg_blue</item>

<item name=*"android:colorBackground"*>@color/*royalblue*</item>

<item name=*"android:textColor"*>@color/*midnightblue*</item>

<item name=*"android:textViewStyle"*>@style/TextViewBlue</item>

</style>
<resources>
This is main activity code snippet

*public* *void* onCreate(Bundle savedInstanceState) {

*super*.onCreate(savedInstanceState);

setTheme(R.style.Theme_Blue);

setContentView(R.layout.
*main_screen*);
...
The background image is not getting loaded but the text color and
textViewStyle got changed.
The background image remains the defalult one -blank screen.
If I am setting the theme in android manifest file then it works properly.
Can anybody tell me the reason for this?

Warm Regards,
Sudeep



-- 
Warm Regards,
Sudeep

--


Sponsored Links


Setting theme in an activity

by Bob Kerns » Mon, 07 Jun 2010 09:59:45 GMT


 Try moving the setTheme(R.style.Theme_Blue) call to before the
super.onCreate(savedInstanceState) call.





--



Other Threads

1. Paid applications - are they downloadable now? By Al Sutton

Hang on, how did you find out that they will be available today? Where
did you hear it from, or you're guessing by Google's "mid next week"
estimate?

On Thu, Feb 19, 2009 at 9:54 PM, ellipsoidmob...@googlemail.com



--~--~---------~--~----~------------~-------~--~----~

2. Checkout email notification

I am not recieving email notification of orders through the Market
even though the correct settings have been selected in GC. We do not
have email/junk filters, is anyone else having this problem?
--~--~---------~--~----~------------~-------~--~----~

3. Replacing the dialer responding to [number keys] pressed ?

4. Paid applications - are they downloadable now? By Al Sutton

5. Any reason for not supporting capital letters in image file names of aapt tool

6. Hint not showing on an EditText if gravity is center?

7. Using LIKE in Android SQLITE