@Override protected void onCancelled() { super.onCancelled(); if (pd != null) { pd.dismiss(); } }
@Override protected void onPostExecute(Void result) { super.onPostExecute(result); if (pd != null) { pd.dismiss(); } }
@Override protected void onPreExecute() { super.onPreExecute(); pd = new ProgressDialog(that); pd.setProgressStyle(pd.STYLE_SPINNER); pd.setTitle("Getting File..."); pd.setMessage("Please wait."); pd.setCancelable(true); pd.setCanceledOnTouchOutside(true); pd.setIndeterminate(true); pd.show(); }
protected void onProgressUpdate(Integer... progress) { super.onProgressUpdate(progress); int total_files = progress[1]; int current_file = progress[0]; progress_download.incrementProgressBy(1); progress_download.setMax(total_files); if (current_file < total_files) { progress_text.setText( "Downloading " + Integer.toString(current_file) + " of " + Integer.toString(total_files) + "."); } else { progress_text.setText("Completed."); resume_pause.setVisibility(View.GONE); // writeProgress( // viewimages.setEnabled(true); } // mProgressDialog.setProgress(progress[0]); progress_download.setProgress(current_file); }
protected void onPreExecute() { super.onPreExecute(); // mProgressDialog.show(); }