Hello,
i have a Activity with a transparent background. The Code is easy:
Manifest:
<activity android:name=".app.TranslucentBlurActivity"
android:label="blluuruurr"
android:theme="@style/Theme.Transparent">
</activity>
styles.xml:
<style name="Theme.Transparent">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/
Animation.Translucent</item>
<item name="android:windowBackground">@drawable/
transparent_background</item>
<item name="android:windowNoTitle">true</item>
<item name="android:colorForeground">#fff</item>
</style>
colors.xml:
<drawable name="transparent_background">#00000000</drawable>
All is fine and it works on the emulator.
But i also have a /res/anim/zoom_in.xml .... the file is present, but
not in use!
If i start the app on the G1 Device, i have no tranparent background.
If i delte the unused /res/anim/zoom_in.xml file, i have a transparent
background on the g1 device. Im very confused :)
Best regards,
Heiko
The TestActivity:
public class TranslucentBlurActivity extends Activity {
/**
* Initialization of the Activity after it is first created. Must
at least
* call {...@link android.app.Activity#setContentView setContentView
()} to
* describe what is to be displayed in the screen.
*/
@Override
protected void onCreate(Bundle icicle) {
// Be sure to call the super class.
super.onCreate(icicle);
// Have the system blur any windows behind this one.
getWindow().setFlags
(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
// See assets/res/any/layout/translucent_background.xml for
this
// view layout definition, which is being set here as
// the content of our screen.
setContentView(R.layout.translucent_background);
}
}
translucent_background.xml:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|center_horizontal"
android:text="background!"
/>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---