AndroidManifest.xml ファイルの <activity ~/> に、
android:theme="@android:style/Theme.Translucent"、または、
android:theme="@android:style/Theme.Translucent.NoTitleBar"
を指定します。
実行結果
- Theme.Translucent
- Theme.Translucent.NoTitleBar
サンプルソースコード
- AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adakoda.android.translucenttest"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".TranslucentTestActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Translucent">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="3" />
</manifest>
※Theme.Translucent.NoTitleBar.Fullscreen も定義されていますが、Android 1.5r3 では意図した結果を確認できませんでした