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.
android:theme=”@android:style/Theme.Dialog”
After that the manifest will look something like this.
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.coderzheaven.pack" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.Dialog"> <activity android:name=".ThemeActivityDemo" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
The activity for which you have added this theme will appear as a dialog as shown in the figure.
Pingback: How to place layouts one over another in andriod using addContentView()? | Coderz Heaven
Pingback: Apply Custom Theme for your activity in android. | Coderz Heaven