Applying Themes And Styles To Activity
Home Courses Community Support
Gray Matter

First Step Towards Android: Introduction »

Understanding Activities and Intents »

Hands On With UI Designing In Android (Controls-Views,Widgets and Layouts) »

Updating... »

Applying Themes And Styles To Activity

An activity consumes or occupies the entire screen by default however; you can also change it according to you, like if you want to apply a dialog theme to an activity so that it will be displayed as a floating dialog.

For example, If you want to customize your activity to display as a pop-up or as a warning message to the user that they are going to perform some actions.

In this case, you can display your activity as a dialog box and in this manner you can seek their good attention.

To apply a dialog theme to an activity, you have to simply modify the <Activity> element in the AndroidManifest.xml file by adding the android:theme attribute:


<?xml version=”1.0” encoding=”utf-8”?>

<manifest xmlns:android=




<application android:icon=”@drawable/icon”


<activity android:name=”.MainActivity”


android:theme=”@android:style/Theme.Dialog” >


<action android:name=”android.intent.action.MAIN” />


android:name=”android.intent.category.LAUNCHER” />



<uses-sdk android:minSdkVersion=”9” />





← Preview

Activity And Activity Lifecycle

Next →

Hiding Activity Title


Our mission is to provide highly effective and quality education via innovative solutions. Geeksdemy look forward to bridge the gap between in-demand technology and academics in order to deliver innovative, easy, interesting and affordable learning across the Globe.


  • Python
  • Game Development with Unity 3D
  • Arduino
  • PCB & Circuit Designing
  • Robotics and Embedded C
  • 8051/8052 Embedded Systems
  • QuadCopter & UAV
  • MATLAB with Robotics
  • Raspberry Pi
Learn On the Go!
Get the Android App
Get the iOS App