The progress bar is not updating. However, this ends when the task is completed.
int totalSms = 12; int currentSms = 0; public class ProgressTask extends AsyncTask<String, Integer, Boolean> { private ProgressDialog dialog; public ProgressTask(ScanInboxActivity activity) { dialog = new ProgressDialog(activity); dialog.setIndeterminate(true); dialog.setCancelable(false); dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); dialog.setMax(totalSms); } protected void onPreExecute() { dialog.setMessage("Scan start"); dialog.show(); } @Override protected void onProgressUpdate(Integer... values) { Log.d(TAG, "in onProgressUpdate: " + values[0]);
source share