title: Multiple database connections in Android (from Activity and Service)
body: <p>I would like to use a SQLite database to store data in an Android application. No problem. But at predefined intervals (every day at 10, 14, 18 and 22 o'clock), I want to run an <code>IntentService</code> that requires access to the database as well. And here comes the problem:</p>
  
  <p>When the user is using the application while the <code>IntentService</code> is started, there will be a problem because there's one database connection active in the <code>Activity</code> and one is to be established in the <code>IntentService</code>. So the database will be locked and the <code>IntentService</code> will fail, right?</p>
  
  <p>How an I achieve that, in these cases, the <code>IntentService</code> just waits for the <code>Activity</code> to finish the current operation (<code>SELECT</code>, <code>UPDATE</code>, etc.) and then runs normally?</p>
  
  <p>In my Activity, I open the database connection (via <code>SQLiteOpenHelper</code>) in <code>onCreate</code> and close it in <code>onDestroy</code>. Does this mean that there's no chance for the IntentService to work on the database in the meantime?</p>