1

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 3

2

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"/> 
Sign up to request clarification or add additional context in comments.

7 Comments

Thanks! What should I write in the name of the theme in order to add the Holo Light theme? This ? - "@android:style/Theme.HoloLight"
Want to use existing HoloLight theme?
@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. :)
Yeah I understood it, but my question was what should I write so my app will have a Holo Light theme
@RoniCopul Are you asking about OwnTheme If yes, you can give anyname whatever you want. Its just identification only. Ex My_HoloTheme
|
1

use this in manifest:

<activity android:name="MyActivity" android:theme="@android:style/Theme.Light" > </activity> 

Comments

1

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

Thanks! The second is the Holo Light theme?
use control + space after Theme.Holo u will get all details

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.