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. Is it possible to apply a frame animation to a Custom Button or Toast View




Ah, well in that case ... if no one else has an answer for you, you could
look at the Toast source and see if it does anything special with it's view
that would cause it not to work. Toast is a pretty special case, so I
wouldn't be surprised if this is not meant to support animations (and I've
never seen any apps do this).

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 

2. Mod: Undangan Launching (Nexian Android Journey - 3)

24GB?? ngak salah nih??




Kepada Yth Pak Agus Hamonangan & moderator id-android,

Bersama ini kami bermaksud untuk mengundang teman-teman id-android
untuk menghadiri peluncuran kerja sama Nexian Android Journey - 3 yang
diadakan di:
Hari/ tgl    : Sabtu, 7 Agustus 2010
Waktu      : 11:30 - 13:30
Lokasi      : FX Mall, Atrium lt.3
                  Jl. Jend. Sudirman
                  Jakarta

Adapun acara yang akan dilangsungkan adalah:
- Press Launch & Performance
- Penjualan HP Nexian Journey - 3 dengan bonus data 24GB untuk 1 tahun.

Untuk informasi penjualan, bagi teman-teman yang ingin membeli HP
Nexian Journey ini bisa mendapatkan discount Rp 500,000 dengan
melakukan pendaftaran di www.facebook.com/dunianexian
Juga pembelian dapat dilakukan dengan cicilan 0% dengan menggunakan
kartu kredit BCA, BII, BNI, BRI, Mandiri & Mega.

Terima kasih atas perhatiannya dan sampai bertemu di acara.
Regards,
Andy Tanamas

--
"Indonesian Android Community [id-android]"

3. Is it possible to apply a frame animation to a Custom Button or Toast View

4. pasar malem kenapa ya?

5. Try to build a XGA App in Emulator

6. sdcard MEDIA_MOUNTED, File.canRead = true, File.canWrite = false

7. Facebook Quickly Releases Fix for Battery Drain Issues in App Update