ProgressDialog pg = new ProgressDialog(context) {
@Override
public void onAttachedToWindow() {
getWindow()
.setType(
WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
super.onAttachedToWindow();
};
};
TextView nullTxt=(TextView)findViewById(R.id.login_textView);
pg.setMessage("如何隐藏进度栏的最大值");
pg.setMax(maxProcess);
pg.show();
Class<?> cla = ProgressDialog.class;
try {
Field field = cla.getDeclaredField("mProgressNumber");
field.setAccessible(true);
field.set(pg, nullTxt);
} catch (Exception e) {
e.printStackTrace();
}