I have an application in which i have to show a progress dialog without the title and message. I only need to show the progressbar animation that comes, but in the center.
I am trying to put the following code:
ProgressDialog pd = new ProgressDialog(this);
ProgressBar pb = new ProgressBar(this);
pd.setContentView(R.layout.customprogressdialog);
pd.show();
but i am getting the error that request Feature must be called before `setContentView’. i have tried doing this also but still i am getting an error.
How do i achieve what i want? What is the logic behind calling requestfeature before setcontentview?
thank you in advance.
Don’t use a ProgressDialog if that’s not what you need. If you want to give a dialog a custom layout, start from scratch with a Dialog or AlertDialog. I think that will fix your problem.