java - Show a spinner while the listview loads with data -
i'm gathering lot of files, , showing them in listview. of workload within constructor of adapter. there way use asynctask , show spinner till data gathered. mean i'd have instantiate adapter's constructor within doinbackground method? how go doing this?
also, list contained within tab. i'm using viewpager. due work being done in constructor, scrolling particular tab major stutter.
you can instanciate adapter using empty list before starting asynctask. in onpostexecute of asynctask, can update list data , call notifydatasetchange
method of adapter. add progressbar , hide in onpostexecute.
Comments
Post a Comment