Currently I'm using translucent background which allo开发者_JS百科ws 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?
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.
using
android:theme="@android:style/Theme.Translucent"
in your activity tag in the manifest file.
精彩评论