EddieH
EddieH

Reputation: 143

On Android, how do I use previous Activity's screen as my new Activity's background without translucent background turning black?

Currently I'm using translucent background which allows for the new Activity to use the previous Activity's screen as the background. However, if I press home and then return to the activity, the translucent background becomes black. Is there a way to avoid the background from turning black?

Upvotes: 1

Views: 938

Answers (2)

Hazem Farahat
Hazem Farahat

Reputation: 3790

using

android:theme="@android:style/Theme.Translucent"

in your activity tag in the manifest file.

Upvotes: 0

rochdev
rochdev

Reputation: 3855

You can use a theme to make any activity translucent.

<activity android:name=".MyActivity" android:theme="@android:style/Theme.Translucent" ..>
    ..
</activity>

This will make the background for the activity translucent also when you return to it. But obviously you can't control the background of the activity behind it.

Upvotes: 2

Related Questions