title: close() was never explicitly called on database, DatabasedObjectNotClosed Exception?
body: <p>I am getting following error even I have closed all instances as soon as I finish calling them: </p>
  
  <pre><code> close() was never explicitly called on database '/data/data/com.click4tab.fragmentvogella/databases/NewOrderDB' 
  
   android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
  </code></pre>
  
  <p>I was not getting this error until I defined this method. </p>
  
  <pre><code>public boolean onOptionsItemSelected(MenuItem item) {
  
          switch (item.getItemId()) {
          case R.id.item1:
              Toast.makeText(MainActivity.this, "Button one pressed",
                      Toast.LENGTH_LONG).show();
              // write data on server
              TestAdapter mDbHelper = new TestAdapter(this);
  
              mDbHelper.createDatabase();
              mDbHelper.open();
  
              try {
                  mDbHelper.writeUnwrittenNetOrder();
                  mDbHelper.close();
  
              } catch (Exception e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
                                 break;
  </code></pre>
  
  <p>And the definition to writeUnwrittenNetOrder: </p>
  
  <pre><code>ArrayList&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
      StringBuffer strbuf = new StringBuffer();
      params.add(new BasicNameValuePair("tag", "add_NetOrderID"));
  
      for (mCur.moveToFirst(); !mCur.isAfterLast(); mCur.moveToNext()) {
  
          String sql3 = "INSERT into NetOrderID (StoreID, Date, SalesManID, NetOrderID) VALUES ("
                  + mCur.getString(0)
                  + ", "
                  + mCur.getString(1)
                  + ", "
                  + mCur.getString(2) + ", " + mCur.getString(3) + ");";
           if((mCur.isLast())){
          strbuf.append(sql3);
           }
           else {
               strbuf.append(sql3 + "#");
           }
          // String sql3 =
          // "INSERT into NetOrderID (StoreID, SalesManID, NetOrderID) VALUES (1,1,80)";
          // sqlQueries.add(sql3);
          Log.e("sql", strbuf.toString());
  
  
      }
  
  
      params.add(new BasicNameValuePair("query", strbuf.toString()));
      Log.e("param","param added");
  
      new SyncWithServer();
      // send params
      SyncWithServer.setParams(params);
      Log.e("param","param set");
  
      // return arraylist
  }
  </code></pre>
  
  <p>Where should I close the mDbHelper to avoid this error, well this error is coming up in Logcat while the database is getting successfully written and the Application is not crashing. </p>