views:

2446

answers:

3

I want to create transparent create on another activity.

How can I achieve this?

+6  A: 

It goes like this:

<activity android:name=".usual.activity.Declaration" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
alex
could you please guide in bit detail???? i am new to android...where to place it in manifest file and other java files i will create as it is how will i associate it???
UMMA
You just add the theme as alex has posted to your activity declaration in the manifest - this bit android:theme="@android:style/Theme.Translucent.NoTitleBar, for each Activity you can assign it the Translucent theme
Donal Rafferty
@UMMA: Using one question mark is typically sufficient. Multiple question marks make people who take the time to answer your questions think you're jumping at their faces.
Matthias
+12  A: 

Add the following style In your res/values/styles.xml file (if you don’t have one, create it.) Here’s a complete file:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="Theme.Transparent" parent="android:Theme">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@color/transparent</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>
  </style>
</resources>

(the value @color/transparent is the color value #00000000)

Then apply the style to your activity, for example:

<activity android:name=".SampleActivity" android:theme="@style/Theme.Transparent">
...
</activity>
gnobal
+1  A: 

make a small correction gnobal

its @android:color/transparent instead of @color/transparent.

It worked only when i replace this. donno what caused error in ur xml.

Janardhanan.S