Skip to content Skip to sidebar Skip to footer

Progress Download Dialog

How do you implement Progress Download Dialog based on the codes below? My codes downloads images from a specific URL then it saves the image file into SD Card and set the image as

Solution 1:

Here you can use the AsyncTask for the show the progressbar/dialogbox .

Show the progress bar visible inside the onPreExecute() method. And performs the image loading operations inside the doInBackground() method. Once this operation is done, we will make progress bar invisible and make imageview visible with that loaded image inside the onPostExecute() method.

For more information check this LINK

Solution 2:

Try using this

finalProgressDialogdialog= ProgressDialog.show(
            YourACtivity.this, "", "Loading...please wait");

    newThread(newRunnable() {
        @Overridepublicvoidrun() {
        SetWallpaper(image_url);
                  if (dialog != null && dialog.isShowing()) {
                        dialog.dismiss();
                    }
        }
    }).start();

}

instead of

SetWallpaper(image_url);

in the onOptionsItemSelected(MenuItem item)

and next use Handlers to handle http://developer.android.com/reference/android/os/Handler.html

Post a Comment for "Progress Download Dialog"