I am using the replication service from couchbase in one of my project.
I would like to show the replication progress using a Progressdialog with percentage.
As the documentation says I am doing this in an AsyncTask
so
@Override
protected Void doInBackground(Void... params) {
//other code
double total = push.getCompletedChangesCount() + pull.getCompletedChangesCount();
progressDialog.setMax(total);
progressDialog.setProgress(push.getChangesCount() + pull.getChangesCount());
//.....end }
On log cat I get
I/LoginActivity: Replication Progress = 51029 <-this number changes
I/LoginActivity: Replication total = 56117 <-this number changes as well
The problem I have is that the progressdialog is stuck in 0%, no progress is showed.
Any idea about how I can solve it?