In the onCreate of an activity we are connecting to a remote system and downloading data. We display a cancellable ProgressDialog to the user all this time. Download is done using AsyncTask. In preExecute(), we show the dialog and in postExecute() we dismiss it.
Problem is that when the download is in progress and ProgressDialog on display, if the user presses the "search" button on the device, the ProgressDialog disappears. The background thread is still running.
What cause this behavior? How can this be avoided?
Please help.
thanks.