Async Json feed finishing later than AyncTasks to load data from sqllite DB. How to sync them or any better solution ?
I searched StackOverFlow but could not find this peculiar problems like mine.
In my app, All data is shown to the user from sqllite DB, which is present in mobile itself. Data in sqlite DB is created using AsyncTask JSON feed on click of buttons. In one case of mine, AsyncTask to download data is kicked off in background but user had already landed in list fragment to see data. To ensure that user is not waiting for download to finished, i implemented this also in Async task. Now, this Async task to show data finished much before Async data to download and insert. This means that user always see old data and have to come back to see new data. Any solution for this peculiar problem would be appreciated. Thanks.