Not sure of the exact application of this but I'll make a suggestion.
If you use an AsyncTask
, you can send it off to get the data you need and in the onPostExcecute()
method you can call your method that requires the data or update the view as needed. (It runs on the UI thread)
If you happen to already have the data you need in certain scenarios you could also bypass the AsyncTask and directly update the view.
This AsyncTask can be triggered in the onResume()
method.
If I'm missing something, please let me know and I can adjust my suggestion.