[android] ProgressDialog spinning circle

I want to implement ProgressDialog like this one, without additional frame.: Pic

But I'm getting this one. How could I change that?

enter image description here

Here is my code for ProgressDialog. Thanks in advance

private ProgressDialog mProgressDialog;
   ............
   mProgressDialog = new ProgressDialog(activity);
   mProgressDialog.setIndeterminate(false);
   mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
   ............
    public class ProgressTask extends AsyncTask <Fragment,Void,Fragment>{
            @Override
            protected void onPreExecute(){
                mProgressDialog.show();
            }

            @Override
            protected Fragment doInBackground(Fragment... arg0) {   
                    //my stuff is here
            }

            @Override
            protected void onPostExecute(Fragment result) {
                   mProgressDialog.dismiss();
            }
        }

This question is related to android android-layout android-progressbar

The answer is


Try this.........

ProgressDialog pd1;
pd1=new ProgressDialog(<current context reference here>);
pd1.setMessage("Loading....");
pd1.setCancelable(false);
pd1.show();

To dismiss....

if(pd1!=null)
 pd1.dismiss(); 

Put this XML to show only the wheel:

<ProgressBar
    android:indeterminate="true"
    android:id="@+id/marker_progress"
    style="?android:attr/progressBarStyle"
    android:layout_height="50dp" />

I was using View.INVISIBLE and View.VISIBLE and the ProgressBar would slowly flash instead of constantly being visible, switched to View.GONE and View.VISIBLE and it works perfectly


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to android-layout

How to check if a key exists in Json Object and get its value How to center the elements in ConstraintLayout Android - how to make a scrollable constraintlayout? Add ripple effect to my button with button background color? This view is not constrained vertically. At runtime it will jump to the left unless you add a vertical constraint Is it possible to put a ConstraintLayout inside a ScrollView? Differences between ConstraintLayout and RelativeLayout How to remove title bar from the android activity? How to have EditText with border in Android Lollipop Android: ScrollView vs NestedScrollView

Examples related to android-progressbar

ProgressDialog is deprecated.What is the alternate one to use? How to create circular ProgressBar in android? How to implement a material design circular progress bar in android How to Create a circular progressbar in Android which rotates on it? How to Customize a Progress Bar In Android ProgressDialog spinning circle How to set the Android progressbar's height? How to create a horizontal loading progress bar? how to access downloads folder in android? How to change ProgressBar's progress indicator color in Android