How to update List Fragment Periodically? I need to query data from SQLite Database and Update ListFragment. For this,can i use Loader Manager?
Am i correct,If i use Loader Manager in my List Fragment,whenever new data availale in sqlite database,it will load that data to my List Fragment Asynchronously?
Make your ListFragment implement Loader.Callbacks.
On the onLoadFinished callback, do something like this;
Obviously this would depend on what adapter you use and so on.
Call it trough
getLoaderManagger.initLoader(int id, Bundle params, , LoaderCallbacks<D> callback);, passing a unique id everytime you call it (with a value based on current time, for example).Besides that, you would need a Timer, which TimerTask run() method would simply init the loader.