Create custom Theme

Description

The following code shows how to create custom Theme.

Example

res/values/theme.xml


<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.NoBackground" parent="android:Theme">
        <item name="android:windowBackground">@null</item>
        <item name="android:windowNoTitle">true</item>
    </style>

</resources>

Set customized theme in manifest file



<?xml version="1.0" encoding="utf-8"?>
<manifest...

    <application
        ...
        <activity
            android:name=".MainActivity"
            android:theme="@style/Theme.NoBackground" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Create custom Theme




















Home »
  Android »
    Android Basics »




Hello Android
Resources
Activity
Calendar
Camera
Contact
Content Provider
Database
Hardware
Intent
Location
Media
Network
Notification
Preference
Sensor
Service
SMS