Android Life Cycle - ListActivity
When my ListView activity loads it creates the Adapter which fills the screen as it should do. Is there an event or way t开发者_运维技巧o find out when the Adapter has finished getting enough data to fill the screen.
I want to show a spinner the first time the Activity loads and have it go away once the screen has its first load of data from the Adapter.
Well as your question suggests, i guess an adapter can only take time if you download data to be shown, If that is the case then you can always use background threads, i.e. extending the AsyncTask
And starting a progressbar (determinate or indeterminate) and removing it after your task is complete...
Hope this helps!
You can spawn a worker thread and create and assign the adapter from there. Refer to this for how to create a worker thread. The adapter doesn't load all the data in the ListView at once. It will load only the visible data; rest will be loaded when you scroll through the ListView.
精彩评论