How can I show a progress dialog without the message?
I only need to show the indeterminate circle. What is the easiest and fastest way of doing this without creating a custom dialog? Is there any method similar to this:
progressDialog.setShowIndeterminateCircleOnly(true)
Hope this will help some as answer is still not easily found.
ProgressDialog progDialog = ProgressDialog.show( getContext(), null, null, false, true );
progDialog.getWindow().setBackgroundDrawable( new ColorDrawable( Color.TRANSPARENT ) );
progDialog.setContentView( R.layout.progress_bar );
2nd line above will remove the box around the progress Circle icon; but it will stay left aligned by default. You will have to add the third line above to handle gravity and any other style in a XML layout file.
progress_bar.xml
<?xml version="1.0" encoding="utf-8"?>
<ProgressBar
xmlns:android="http://schemas.android.com/apk/res/android"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
You do not have to define the style above if you like the default smaller circle Icon
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