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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -