title: Activity and Background Service Access to SQLite Database
body: <p>I want to check if a SQLite Database is open, and if it is, I would like to access that Database within a service class. </p>
  
  <p>I am worried, and have seen, that multiple open calls to the database clash, and throw exceptions. Because I do query the database within both my Activity and Service classes, I am attempting to implement the solution Commonsware recommended here: <a href="https://stackoverflow.com/questions/4842112/when-to-close-db-connection-on-android-every-time-after-your-operation-finished/4842251#4842251">When to close db connection on android? Every time after your operation finished or after your app exit</a>. However I do not want to close then open the Database within the Service class if the Activity might need it. From this answer <a href="https://stackoverflow.com/questions/7058267/why-use-sqliteopenhelper-over-sqlitedatabase">Why use SQLiteOpenHelper over SQLiteDatabase?</a>, it looks like it might make sense to implement a SQLiteOpenHelper to solve the issue of making multiple calls. </p>
  
  <p>Thank you so much for all your help!!</p>