I don’t see how the progress counter works in ProgressDialog on Lollipop

Creating an application using ProgressDialog, and it is perfectly visible on JellyBean, but when testing with Lollipop I see only the title and message, there is no progress scroll. I use

compile 'com.android.support:appcompat-v7:22.2.0' 

Support Library and AppCompatActivity

The code:

  ProgressDialog progressDialog = new ProgressDialog(AddBuddyActivity.this); progressDialog.setMessage("Loading..."); progressDialog.setCancelable(false); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); progressDialog.show(); 

You can see another question that I posted on the same topic here .

+7
android dialog spinner progress
source share
2 answers

NOTE Here you can see the pseudo-duplicate of this question. One in the link is a little more thorough, but both have the same solution.

It seems that the answer, if the user has disabled transitions in the developer’s settings, your animations in the ProgressDialog (namely, the Progress Spinner) will not be displayed. Turn them on and restart the application and you will see the spinner!

The solution to turn off animations with the settings disabled seems to be to create a custom dialog that admittedly will look better than the standard ProgressDialog.

And, as a fair warning to people trying to abuse ProgressDialog, listen to these words from the documentation developer:

Android includes another dialog class called ProgressDialog, which shows a dialog with a progress bar. However, if you need to specify loading or undefined progress, you should follow the recommendations for developing Progress and activity and use the ProgressBar in your layout.

From this, I believe that using them for long calls over the network is fine, while downloading information or a long local process should be indicated using one of the other progress components.

+15
source share

I use this in Lollipop. Let me know if this works for you. The support library I'm using supports android-support-v4.jar

 import android.app.ProgressDialog; ProgressDialog dialog = ProgressDialog.show(this, "Title", "Message ", true, true);//Put this where you need it 

This works fine for me: Droid Razor M with 4.4.2 Samsung Note 4 with 5.0.1 Samsung Galaxy 6 Edge with 5.1.1

+2
source share

All Articles