tags:

views:

184

answers:

1

Hi,

Tried posting this at android dev, wanted to go here too in case anyone knows. I'm trying to supply a custom background drawable for a dialog. I've created the following in my styles.xml file:

 <style name="CustomDlg" parent="@android:style/Theme.Dialog"> 
   <item name="android:windowBackground">@drawable/my_background</item> 
 </style> 

This works fine on 1.6+. On my g1 running 1.5 (and the 1.5 emulator) the drawable is used, but the area around the dialog is opaque black instead of being translucent.

Is there something I'm missing here, or is this a bug with 1.5? Any work arounds? Is 1.5 just the ie6 of Android?

Thanks

A: 

Hi

Have you tried using the windowManager

WindowManager.LayoutParams lp = dialog.getWindow().getAttributes();  
lp.dimAmount=0.2f;  
dialog.getWindow().setAttributes(lp);  
// If you would like an additional blur-effect, can be slow
// dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); 
PHP_Jedi
Arghh not even that works - on 1.6+ I can see it does have an effect - what is wrong with this thing!?
Sorry PHP_Jedi, this probably *does* work, I restarted my G1 by chance and it started working with the original code I posted, so frustrating. Thanks for your help!