I use CursorLoader to show data in my recycler view. I also need provide delete and update item feature. What is the best solution to delete and update items in database? Now I use simple AsyncTask.
The best solution is to use AsyncQueryHandler?
According to the guidelines it depends. If you want your app to sync with the server after a certain period of time(2-24hrs), use SyncAdapter. If you dont need to sync, use service or intentservice.
AsyncTask not the best option, the latest "efficient" apps nolonger use it
The main problem with the asyncTask is that its lifetime is tied to the activity. So if your app is doing a background process like inserting new data into the DB and the activity closes or the user presses the back button, the process may be terminated before completion