kabuto178
kabuto178

Reputation: 3167

Running an AsyncTask periodically

I want to update a ListView every 30 seconds with new data being loaded from an AsyncTask. I want to get some advice as to the best methods to carry this kind of activity out, or if it would not be advised to update the view in this fashion. Thank you.

Upvotes: 0

Views: 353

Answers (1)

stinepike
stinepike

Reputation: 54742

you can use recursinve handler.postdelayed method to call asynctask.. But if you want my suggestion I will tell you to implement CursorLoader in your caseou

To know more about cursor loader you can check these links ( first 3 google search :p)

https://developer.android.com/training/load-data-background/setup-loader.html http://www.codeproject.com/Articles/525313/Using-Cursor-Loader-in-Android http://developer.android.com/reference/android/content/CursorLoader.html

Upvotes: 1

Related Questions