If an activity uses a private SQLiteOpenHelper, calls .open() on it and uses the database; when should we call .close()?
Furthermore, what are the repercussions of not using .close() properly
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.
open()sets a lock on the database, so that no other instance can use it. soclose()is a necessity that you are done with using the database , This is to ensure there are no discrepancies in the data. think about another instance changing the data, that you are trying to access. so only 1 instance can be made for your db, which requires,proper locking and unlocking.