February 5, 2012

How to make your activity appear like a dialog box in android?

Hello all..

Today I will talk about how to theme your activities the way you want.
Besides that android provides many built in themes that you can use instead of all writing it yourselves.
One of those kind is making the activity appear like a dialog box.

Here is how you do it.
After creating your activity -> go to AndroidManifest.xml. then add this inside the activity tag.


After that the manifest will look something like this.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
    <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.Dialog">
        <activity android:name=".ThemeActivityDemo"
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />

The activity for which you have added this theme will appear as a dialog as shown in the figure.

Theme Android activity

Theme Android activity

Website Pin Facebook Twitter Myspace Friendfeed Technorati Digg Google StumbleUpon Premium Responsive

Leave a Reply

Your email address will not be published. Required fields are marked *