There is no progress in the ProgressDialog.

I am trying to create a ProgressDialog, as shown in almost every application on the Play Store. I am using the code:

getActivity().runOnUiThread(new Runnable() { @Override public void run() { ProgressDialog dialog; dialog = ProgressDialog.show(getActivity(), "title", "message", true, false); } }); 

I also tried with only two lines inside Runnable (without creating a thread) from inside the fragment, and no matter what I do, I don't see the spinner in the ProgressDialog . I am attaching a screenshot so you can see what I mean. Someone PLEASE help me.

Running Android 5.1.1 on Galaxy S6, all OS OS.

EDIT : Import:

 import android.app.Fragment; import android.app.ProgressDialog; 

enter image description here

+3
android progressdialog spinner invisible
source share
4 answers

Check with the style you are using res / values โ€‹โ€‹/ style and add a new one or change the color

styles.xml

  <style name="MyDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert"> <item name="colorPrimary">@color/orange</item> </style> 

actyity

ProgressDialog progressDialog = new ProgressDialog(ProfilActivity.this,R.style.MyDialogTheme);

+2
source share

Try

  ProgressDialog progressDialog = new ProgressDialog(context); progressDialog.setMessage("[YOUR MESSAGE]"); progressDialog.setCancelable(true); // Check as required progressDialog.show(); 
0
source share

Tal drove a sea tarde feather buske decision por Todos Lados and Vi Una, espero que sirva

  Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.dialog_login); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); dialog.show(); 

you have a simple layout

 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <ProgressBar android:id="@+id/progressBar" style="?android:attr/progressBarStyle" android:layout_width="match_parent" android:layout_height="wrap_content" /> </LinearLayout> 
0
source share

If you use snippet, use getActivity () instead

  ProgressDialog progressDialog = new ProgressDialog(getActivity()); progressDialog.setMessage("[YOUR MESSAGE]"); progressDialog.setCancelable(true); // Check as required progressDialog.show();*/ 

This work is for me :)

-one
source share

All Articles