I am trying to do display a ProgressBar.
I am an Android beginner.
When I press the button, the task should be running in the background, but it does not display
Use ProgressDialog. You don't need any layout in this case.
ProgressDialog
ProgressDialog progressDialog = new ProgressDialog(context);
in onPreExecute show it
onPreExecute
progressDialog.show();
and in onPostExecute dissmiss it
onPostExecute
progressDialog.dismiss();