dear friends,
i dont what to give any background to activity when i leave this propery blank it gives me error
and i have tried using @null as a value but it shows black background.
can any one guide how to make it transparent??
dear friends,
i dont what to give any background to activity when i leave this propery blank it gives me error
and i have tried using @null as a value but it shows black background.
can any one guide how to make it transparent??
For an Activity you can set the theme to translucent in the onCreate method:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...
setTheme(android.R.style.Theme_Translucent);}
You could also do this in the xml file like in this tutorial.
You should do this using styles. In res/values/styles.xml
, have a theme definition:
<style name="MyTheme">
<item name="android:background">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
</style>
As far as I know, you must set windowIsFloating, otherwise the runtime will not draw a translucent background (presumably for performance reasons... but I have seen this behavior change between different platform releases, so you could first try without it).
Then set the theme for your Activity in the manifest:
<activity android:name="..." android:theme="@style/MyTheme" ... />
That should do the job.