I have a web service from which i receive data, put it in a database and from there display it on an activity.
i want my activity to wait until my xml parser thread has put data in the database before displaying the xml file.
How do i go about it?
I am right now passing a Handler object of my activity to my parser thread and once the parsing is done, i pass a message to the handler. The handler on the other end is now going to populate the listview which will show the data from the database.
Is there any other way of doing the same?
thank you in advance.
Look into the observer pattern it is for this kind of situation.