in this tutorial it is said that there are 3 themes for apps, but not mentioned how to set what theme will be my app.
So my question is how can I set a theme for my app?
Thanks!
3 Answers
Setting existing Theme to app from SDK Source
<activity android:name=".MainActivity" android:theme="@android:style/Theme.NoTitlebar" /> Simply you can set theme for your app..
Setting Own Theme
And, also you can create your own theme for your app. For this you've to place it one xml file under res/styles.xml For, example -
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="OwnTheme" parent="android:Theme"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsFloating">true</item> <item name="android:backgroundDimEnabled">true</item> </style> </resources> This is a example for theme. You can create your own theme like this. After creating your theme you can set this to you activity in manifest file -
<activity android:name=".ShowZoomedImage" android:theme="@style/OwnTheme"/> 7 Comments
Roni Copul
Thanks! What should I write in the name of the theme in order to add the Holo Light theme? This ? - "@android:style/Theme.HoloLight"
Praveenkumar
Want to use existing
HoloLight theme?Praveenkumar
@RoniCopul See, if its a existing theme from android-sdk then you don't need to create any xml file for this and don't need to give any name for that. But, if you're using your own theme You've to give any name for identification to xml & manifest file. :)
Roni Copul
Yeah I understood it, but my question was what should I write so my app will have a Holo Light theme
Praveenkumar
@RoniCopul Are you asking about
OwnTheme If yes, you can give anyname whatever you want. Its just identification only. Ex My_HoloTheme |
use this in ur manifest file
<activity android:name=".yourActivity" android:theme="@android:style/Theme.Dialog" > </activity> <activity android:name=".YourActivity2" android:theme="@android:style/Theme.Holo" > </activity> 2 Comments
Roni Copul
Thanks! The second is the Holo Light theme?
ashish.n
use control + space after Theme.Holo u will get all details