How do I remove the black background from a dialog box in Android. The pic shows the problem.
final Dialog dialog = new Dialog(Screen1.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.themechanger);
How do I remove the black background from a dialog box in Android. The pic shows the problem.
final Dialog dialog = new Dialog(Screen1.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.themechanger);
In case you extended the
DialogFrament
class, you can set the theme with:And then make the custom theme in your styles.xml file (see @LongLv's answer for parameters)
Don't forget to add
<item name="android:windowCloseOnTouchOutside">true</item>
if you want the dialog to close if the user touches outside the dialog.Add this code
Edit
Somehow Zacharias solution didn't work for me so I have used the below theme to resolve this issue...
One can set this theme to dialog as below
Enjoy!!
Same solution as zGnep but using xml:
This is what I did to achieve translucency with AlertDialog.
Created a custom style:
And then create the dialog with:
You can use the:
method.And following is the doc: