Question: Android 2.3.3

I have a progressdialog that shows, Loading.. as text. Here is the code for the progressdialog .

```
progressDialog = new ProgressDialog(mContext);      
            progressDialog.setIndeterminate(true);
            progressDialog.setMessage("Loading...");
            progressDialog.show();

```

If I remove the line `progressDialog.setMessage("Loading...");`, I get a progressdialog of the left and an empty box on the right that occupies the width of the parent. 

I want to display only the progressdialog , aligned at the center. Please refer to the images below..

This is what i have...

![enter image description here](https://i.stack.imgur.com/fwUlD.png)

This is what i want...

![enter image description here](https://i.stack.imgur.com/Owau1.png)

Can someone help me with this?

Answer: 
You can use:

```
Progress progress = new ProgressDialog(getActivity(), android.support.v4.app.DialogFragment.STYLE_NO_TITLE);

```

If necessary, add to Gradle dependencies

```
compile 'com.android.support:support-v4:22.2.0'

```
You can do this by just creating one class which extends Dialog class: 

Let's say I have created below class:

```
public class TransparentProgressDialog extends Dialog {

    public ImageView iv;

    public TransparentProgressDialog(Context context, int resourceIdOfImage) {
        super(context, R.style.TransparentProgressDialog);
        WindowManager.LayoutParams wlmp = getWindow().getAttributes();
        wlmp.gravity = Gravity.CENTER_HORIZONTAL;
        getWindow().setAttributes(wlmp);
        setTitle(null);
        setCancelable(false);
        setOnCancelListener(null);
        LinearLayout layout = new LinearLayout(context);
        layout.setOrientation(LinearLayout.VERTICAL);
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        iv = new ImageView(context);
        iv.setImageResource(resourceIdOfImage);
        layout.addView(iv, params);
        addContentView(layout, params);
    }

    @Override
    public void show() {
        super.show();
        RotateAnimation anim = new RotateAnimation(0.0f, 360.0f , Animation.RELATIVE_TO_SELF, .5f, Animation.RELATIVE_TO_SELF, .5f);
        anim.setInterpolator(new LinearInterpolator());
        anim.setRepeatCount(Animation.INFINITE);
        anim.setDuration(3000);
        iv.setAnimation(anim);
        iv.startAnimation(anim);
    }
}

```

Put `TransparentProgressDialog` in style.xml:

 @null
 @android:color/transparent
 true
 @null
 @null
 @android:style/Animation.Dialog
 stateUnspecified|adjustPan
 true
 @android:color/transparent

Now you can put any progress image which will circulate:

```
TransparentProgressDialog pDialog = new TransparentProgressDialog(mContext, R.drawable.progress);
pDialog.show();

```

That's it.