Background: When making a progress bar, do not want its background dimmed, so as not to affect the normal display of other areas.
Most of the methods you see when searching the Web are:
Method One: In the code can be set so Window Mwindow = GetWindow ();
Windowmanager.layoutparams LP = Mwindow.getattributes (); Lp.dimamount =0f;
Method Two: Set the following in the style XML
<resources>
<style name= "Dialog" parent= "@android: Style/theme.dialog" >
<item name= "android:backgrounddimenabled" >false</item> <!--activity is not dimmed --
</style>
</resources>
Set to True, darken background Dialog = new Dialog (Activity, R.style.dialog);
Because I use Progrossdialog, I try to use method one, not successful.
Then I use the second method, in the Values folder to add Style.xml, which writes the above code, with Progressdialog.setprogressstyle (R.style.dialog);
It also didn't work, and here I think Progressstyle should refer to the style of the progress bar, regardless of the background. Just holding on to the attitude of trying. Feel that you should be able to customize its background through Setview, but it's relatively troublesome.
Later, see this way:
Method Three: Similarly configure style, such as method two, and then in the pop-up window of the parent window or activity of the business base class, write code:
protected void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); SetTheme (R.style.dialog); }
Try it out and fix the problem.
ProgressDialog the background of the popup is dimmed (turn)