How to dynamically apply themes in Android

by kirti kaul » Fri, 04 Dec 2009 20:24:36 GMT

Sponsored Links

My query is regarding on whether we can apply dynamically themes in
android,like what we do with our phones in which we can select a theme
and the same theme gets applied all across the phone.Is there a way to
do this in android ????

(I am able to change the default theme by hardcoding in the code
(styles.xml),but I need to know how we can we set themes dynamically.
I saw the Android phone,but there is no Setting where we can set the

Any help will be appreciated!!!



How to dynamically apply themes in Android

by Nithin » Fri, 04 Dec 2009 21:06:16 GMT


We can dynamically set using setTheme(). The constant you need to put



Sponsored Links

How to dynamically apply themes in Android

by kirti kaul » Mon, 07 Dec 2009 11:07:33 GMT

 Thanks,Have u tried it?I mean are you able to change the theme on
runtime?I mean dynamically in the emulator?


How to dynamically apply themes in Android

by Nithin » Mon, 07 Dec 2009 12:25:55 GMT


Its not working in java code. Its working when put theme in manifest
only. In 1.1 SDK, i used setTheme() and it worked perfectly, but now
its not working. 


How to dynamically apply themes in Android

by kirti kaul » Mon, 07 Dec 2009 14:42:19 GMT

 Thanks,I tried with
and this seems t owork,but my question is how do we change the Theme
of the whole system Dynamically?I mean the user should be able to
change the themes dynamically from the phone(emulator)


Other Threads

1. Custom ArrayAdapter add items programmatically

I need some help.
i've create a custom ArrayAdapter and override getView method like

View v=convertView;
                        LayoutInflater li = (LayoutInflater)
                        v = li.inflate(R.layout.dynamic_element_layout, null);
In my dynamic_element_layout.xml i defined one table layout with 2
row. In the first row i have one TextView and i set the text for this
in my  getView method(that works ok) the problem is that i want to
programmatically add an other control in my second table row
(EditText, Spinner, etc) and it's not working. I tried:

TableRow tr=(TableRow) v.findViewById(;
TextView tv=new TextView(getContext());
                tv.setLayoutParams(new LayoutParams(


Can somebody help me with this issue??


2. load an image from a URL

How to load an image from a URL in a ImageView ?

I tried this :

ImageView imgVw = (ImageView)findViewById(;

But it doesn't work !!



3. Pake paket,pulsa tetep berkurang

4. New to android development

5. how to listen messages from http server

6. Best way to do this

7. How do I stop the emails