I use an AsyncTask with a ProgressDialog in it. This automatically causes a background dim of about 40%. I want to turn this dim off (0% dim), but what I tried, didn't work:
myLoadingDialog = new ProgressDialog(MainActivity.this.getApplicationContext()); myLoadingDialog.setMessage("Loading..."); myLoadingDialog.setIndeterminate(true); myLoadingDialog.setCancelable(false); WindowManager.LayoutParams lp = myLoadingDialog.getWindow().getAttributes(); lp.dimAmount = 0.0f; myLoadingDialog.show();
The problem with that dim was, that I had to terminate my Tablet's SystemUI-Process to achieve a Kiosk mode (with no System-Bar) and the ProgressDialog dims everything but the area where the System-Bar was, so I have a bright border at the bottom of the screen.
If there is a way to get a complete fullscreen-dim, I would be also happy.
Thanks for any help
AlertDialog generally consists of the main title, the message, and two buttons, technically termed as a positive button and a negative button. Both positive and negative buttons can be programmed to perform various actions. By default, the negative button lets close the AlertDialog without any additional lines of code.
ProgressDialog is a modal dialog, which prevents the user from interacting with the app. Instead of using this class, you should use a progress indicator like ProgressBar , which can be embedded in your app's UI. Alternatively, you can use a notification to inform the user of the task's progress.
use
myLoadingDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With