How to call invalidate() late on ViewPager

473 Views Asked by At

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?

1

There are 1 best solutions below

4
On BEST ANSWER

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?