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: 
If you happen to get the **error** : "`requestFeature() must be called before adding content`", the solution is to call `progressDialog.show()` BEFORE you call `progressDialog.setContentView(R.layout.progressdialog)`.
What I have done is..

```
private ProgressDialog progressDialog;

private void loadProgressDialog() {
    try {
        progressDialog = new ProgressDialog(this);
        progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        progressDialog.setMessage("Please Wait...");
        progressDialog.setIndeterminate(false);
        progressDialog.setCancelable(false);
        progressDialog.setCanceledOnTouchOutside(false);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

private void showProgressDialog() {
    if (progressDialog != null && !progressDialog.isShowing()) {
        progressDialog.show();
    }
}

private void hideProgressDialog() {
    if (progressDialog != null && progressDialog.isShowing()) {
        progressDialog.dismiss();
    }
}

```

[Output](https://i.stack.imgur.com/lI6S5.jpg)