1

I have few doubts regarding transparent AlertDialog box in android.I have created the alert dialog box using AlertDialog.builder in the camera surface view but i want Transparent alert dialog box is it possible. please help me

Regards Raj

sanraj
  • 47
  • 3
  • 9

2 Answers2

14

Use this
The code is as follows

Dialog mDialog = new Dialog(mContext, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);  

Answer taken from a similar answer here

Community
  • 1
  • 1
Shadow
  • 6,161
  • 3
  • 20
  • 14
8

Yes, this is possible. I believe you can do it by creating a custom alert dialog:

http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog

you can then set the background of your custom dialog to transparent like so:

this.getWindow().setBackgroundDrawableResource(R.drawable.transparent);

(where "R.drawable.transparent" is a reference to the color "#00000000")

Alan Moore
  • 6,525
  • 6
  • 55
  • 68