I am not able to see any progress updates in progress dialog.
In the activity class:
void retrieveImages()
{
mImageUriList = new ArrayList<String>();
mImageUriList = Utils.fetchImages(this);
mProgressDialog = new ProgressDialog(this);
// progress dialog here is class level activity member
mProgressDialog.show();
mProgressDialog.setIndeterminate(false);
mProgressDialog.setMessage("Processing Images..");
mProgressDialog.setMax(100);
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.setCanceledOnTouchOutside(false);
new GetImageAsyncTask(this, mImageUriList,mProgressDialog).execute();
// passing progress dialog to async task
}
In the AsyncTask
@Override
protected Void doInBackground(Void... params)
{
int progress_status;
float count=imageUriList.size();
float increment=0;
float p=(increment/count)*100;
for(int i=0;i<count;i++)
{
increment++;
//do some operation
p=(increment/count)*100;
progress_status=Math.round(p);
publishProgress(progress_status);
Log.i(TAG, "progress value-"+progress_status);
}
return null;
}
@Override
protected void onProgressUpdate(Integer... values)
{
//super.onProgressUpdate(values);
progressDialog.setProgress(values[0]);
}
I can only see spinner and message "Processing images..", i do not see any progress bar/updates
I am using ActionBarSherLock, I also tried this solution here that also does not seems to work, also it just shows progress spinner on action bar. I want a dialog to show progress, not on action bar.