Roni Copul
Roni Copul

Reputation: 183

Setting the theme of the app

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!

Upvotes: 1

Views: 391

Answers (3)

Praveenkumar
Praveenkumar

Reputation: 24476

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"/>

Upvotes: 2

ashish.n
ashish.n

Reputation: 1224

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>

Upvotes: 1

Bob
Bob

Reputation: 23000

use this in manifest:

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

Upvotes: 1

Related Questions