0

I'm trying to develop an application to understand android, application delete's default browser's history. Every thing is working fine, I'm using AsyncTask to accomplish the task with ProgressDialog

Here is how I'm deleting the History

ProgressDialog pd;

new AsyncTask<Void, Void, Void>() 
    {
        @Override
        protected void onPreExecute() 
        {
            pd = ProgressDialog.show(HistoryClean.this, "Loading..",
                    "Please Wait", true, false);
        }//End of onPreExecute method

        @Override
        protected Void doInBackground(Void... params) 
        {
            Browser.clearHistory(getContentResolver());

            return null;
        }//End of doInBackground method

        @Override
        protected void onPostExecute(Void result) 
        {
            pd.dismiss();               

        }//End of onPostExecute method
    }.execute((Void[]) null);//End of AsyncTask anonymous class

But instead of ProgressDialog I want to implement CircularProgress which it can display the progress value like 10% , 90%....

Some times History may gets deleted faster and some times it may be slow, how to address this problem and dynamically update the CircularProgress bar with Progression Values.

Thanks in advance.

Chethan Shetty
  • 1,972
  • 4
  • 25
  • 45

2 Answers2

0

The best two library i found on the net are on github https://github.com/Todd-Davies/ProgressWheel https://github.com/f2prateek/progressbutton?source=c Hope that will help you

Sanket Kachhela
  • 10,861
  • 8
  • 50
  • 75
0

AsyncTask has method onProgressUpdate(Progress... values) that you can call each iteration for example or each time a progress is done during doInBackground() by calling publishProgress(Progress...).

Refer to the docs for more details

Sunil Mishra
  • 3,796
  • 1
  • 27
  • 40