I have applied an theme for my app by defining the android:theme in my AndroidManifest.xml like following:
AndroidManifest.xml:
<application
android:label="@string/app_name"
android:theme="@style/Theme.MyTheme" >
<activity
android:name=".MainActivity"
...
...
</activity>
...
</application>
in themes.xml:
<style name="Theme.MyTheme" parent="@android:style/Theme.Holo">
<item name="android:windowBackground">@drawable/blue_bg_img</item>
</style>
As you can see above in MyTheme, I have applied an blue color image as my app windowBackground. So, every view element in my app will have this blue color image background.
But I have one ImageView element which I do not want to have this blue windowBackground, instead, I would like to have a transparent background for it. I tried to:
myImageView.setBackgroundColor(Color.TRANSPARENT);
But the blue image defined in my app theme is still showing. Seems I can not override the app theme I have defined. How can I override my theme for one View element in my app ???
Finally, I managed to solve this problem myself by decreasing the height of my ImageView element until the blue background is not visible. If other people have other solutions, I am very pleased to see.