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
You are not calling dialog.show() in onPreExecute method of your AsyncTask.
dialog.show()
onPreExecute
AsyncTask