I'm using Parse.com with Android to import some data and fill a listview with it. I'm having some trouble with asynchronicity.
I've got a class called DataHandler which when instantiated imports the data from a database and puts it into an arraylist. Then, in the fragment where the listview is, I create a new Datahandler and get the ArrayList from it. Then I fill the listview with this array.The thing is that I don't know where to do this last thing.
I need to somehow wait for the data to be imported into the arraylist before I fill the listview with the information. If the ParseQuery was in the fragment I used, I could just use a callback method, but its in a whole different class, and its used several times for several other fragments. What way is there to only call the logic to fill the listview (creating and setting the adapter) when I know the arraylist has been initialized, without removing the DataHandler class?