Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ProgressDialog style

I show ProgressDialog in AsyncTask method. My code as below:

@Override
protected void onPreExecute() {
super.onPreExecute();
progDailog = new ProgressDialog(MyActivity.this.getParent());
progDailog.setIndeterminate(false);
progDailog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progDailog.setCancelable(true);
progDailog.show();
}

The dialog showed has a long space at right. But I want to show only the left cycle image without the right space. How to modify it?

like image 603
brian Avatar asked Jul 11 '26 06:07

brian


1 Answers

The space on the right is because normally there is also a Text to the right of the spinner. If you just want to show the spinner try it with AlertDialog:

AlertDialog.Builder builder = new AlertDialog.Builder(this);
ProgressBar pbar = new ProgressBar(this);
builder.setView(pbar);
builder.create().show();
like image 64
Thommy Avatar answered Jul 13 '26 20:07

Thommy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!