May 9, 2011

Make you App looked like a Dialog

To make your app looked like a dialog, you can use the Android pre-defined Theme.Dialog.

Modify AndroidManifest.xml, to add the code inside
android:theme="@android:style/Theme.Dialog"

example:
Make you App looked like a Dialog

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.AndroidDialog"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="4" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".AndroidDialog"
android:label="@string/app_name"
android:theme="@android:style/Theme.Dialog">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>
</manifest>


2 comments:

  1. Can I make an application that not in fullscreen?
    Then, I can drag it around, and it is always on top.
    At the same time, I can control something behind it.
    Is it possible to do something like this?

    ReplyDelete
    Replies
    1. As my understand, you cannot make a Activity not in fullscreen, but you can make it like a Dialog (as this post), or Set background of your app to be transparent.

      Delete

Infolinks In Text Ads