How to show translucent activity?

android, android-activity, transparency

Solution

Declare your activity in manifest like this:

<activity android:name=".yourActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>

and add a transparent background to your layout.

To avoid black flickering you should disable activity animation by creating a style:

<style name="noAnimTheme" parent="android:Theme">
  <item name="android:windowAnimationStyle">@null</item>
</style>

then in manifest set it as theme for activity or whole application.

<activity android:name=".ui.yourActivity" android:theme="@style/noAnimTheme">
</activity>

Or just specify `Intent.FLAG_ACTIVITY_NO_ANIMATION` flag when starting activity.

Problem

How can I create a translucent activity on top of my activity to show help contents? I've seen many apps showing help content over a translucent screen(like when a spinner dropdown is shown, the rest of the screen goes dim and the drop down is projected. I want to create that dim screen)

Original source

Related problems