title: Cannot access Database from Broadcast receiver class android
body: <p>I can Access Database function from my Activity and it works fine. But when I use the same in Broadcast receiver class it fails and gives me default value of cursor ,And my logcat shows this:</p>
  
  <blockquote>
    <p>close() was never explicitly called on database
    DatabaseObjectNotCloseException</p>
  </blockquote>
  
  <p>I have also done </p>
  
  <pre><code>db = context.openOrCreateDatabase("blitz.db", 0, null);    
  dh=new DataHelper(context);
  </code></pre>
  
  <p>and passed the context of <code>onReceiver</code> method to <code>DataHelper</code> Class.
  It shows error on this line</p>
  
  <pre><code>OpenHelper openhelper=new OpenHelper(this.context);
  this.db=openhelper.getWritableDatabase();
  </code></pre>
  
  <p>Please let me know where I am going wrong</p>