I have a database with _id etc.
I want to load this data via a LoaderManager & Loader to an adapter but I’m not sure how.
Can anyone explain an easy yet efficient way to use a LoaderManager & loader with an sqldatabase ?
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The nicest way I’ve found to use the
AsyncTaskLoaderhas been detailed in this tutorial on the Android Design Patterns blog. This example is returning aSampleItemobject but it wouldn’t be much to port the code to return aCursorand then perform the database query in theloadInBackgroundmethod.I thoroughly recommend you have a read through all the parts of the series, it’s a good read 🙂