I have a spinner which is populated from the database. This in turn is pulled from a webservice so it is not possible to hard-code the values.
The spinner is part of a form that the user fills out and saves and I need them to be able to go back in and edit the values, so I am trying to auto-populate it based on what was selected.
The problem is that the spinner does not always select, which happens more often than not. I think this is due to the fact that I am loading the data asynchronously using an asynctask, and by the time it retrieves the data the spinner has yet not been loaded. I have logging showing that, for example, spinner item 4 was pulled from the database, but the spinner shows nothing selected.
What is the best way to find out when the loader has been completed so that I can populate (ie select) the relevant item in the list?
I put the call at the end of the load finished method,