Is it necessary or even good practice to always access an SQLiteDatabase from an AsyncTask?
Doing it from the UI thread seems to cause no problems and is much simpler to implement.
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.
It is recommended to not perform IO from your main application thread, but, it does not have to be done using an
AsyncTask.You have other options for getting out of your main thread too, some of which include the Loader Framework, IntentService, and Executors.