WindowManager.LayoutParams lp=dialog.getWindow().getAttributes();
lp.alpha=0.5;
dialog.getWindow().setAttributes(lp);
WindowManager.LayoutParams lp=dialog.getWindow().getAttributes();
lp.alpha=0.5;
dialog.getWindow().setAttributes(lp);