Display last activity at screen

Put your problem here if it does not fit any of the other categories.

Display last activity at screen

Postby LordYu » Fri Feb 18, 2011 11:06 am

Hi AndDev,

I need to display the last activity open in my screen for a new apps but I don't know how to do that...
To explain my request I want to do something like the "crack screen" apps that display home to modify it.

Hope you can help me.

Posts: 8
Joined: Wed Nov 03, 2010 12:48 pm


Re: Display last activity at screen

Postby blundell » Thu Feb 24, 2011 11:32 pm

All you do is set the background of your activity to see through.

Try this in your Activity in the manifest:
Code: Select all
<activity android:name=".usual.activity.Declaration" android:theme="@android:style/Theme.Translucent.NoTitleBar" />


Code: Select all
<?xml version="1.0" encoding="utf-8"?>
  <style name="Theme.Transparent" parent="android:Theme">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">#00000000</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:backgroundDimEnabled">false</item>

And in your activity XML:

Code: Select all
<activity android:name=".SampleActivity" android:theme="@style/Theme.Transparent">

http://stackoverflow.com/questions/2176 ... in-android
User avatar
Master Developer
Master Developer
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK


Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 6 guests