I'm using TouchDB to replicate a DB and display its contents in a series of ListViews in a ViewPager. The problem I'm having is that on the first replication TouchDB calls it's onSuccess()/onPostExecute() methods before it's finished replicating, meaning I can't call invalidate() on my ViewPager to get it to draw the ListViews.
Is there any solution to this?
You can add a runnable that will invalidate to the end of your run queue.
myView.post(new Runnable() {
@Override
public void run() {
myView.invalidate();
}
});
Does this work?