Tuesday, July 12, 2011

Reducing dimness while running Progress Dialog in Android

In Android while running progress dialog the screen become dim. The following snippet helpful to reduce the dimness.
 pdlg = ProgressDialog.show(getParent(), "Loading...", "");
WindowManager.LayoutParams lp = pdlg.getWindow().getAttributes();
 lp.dimAmount=0.0f;        //Dim Amount
 //Applying properties to progress dialog
 pdlg.getWindow().setAttributes(lp);
//Dismiss the dialog
pdlg.dismiss();
 

No comments:

Post a Comment