title: Why returning values from sqlite returns an empty array
body: <p>Im using the following code to add values to db.</p>
  
  <pre><code>public void addComplianceAcceptability(ComplianceAcceptability complianceAcceptability) {
      SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();
      ContentValues contentValues = new ContentValues();
  
      contentValues.put(KEY_ID, complianceAcceptability.getId());
      contentValues.put(KEY_COUNTRY_ID, complianceAcceptability.getCountryId());
      contentValues.put(KEY_DOMAIN_ID, complianceAcceptability.getDomainId());
      contentValues.put(KEY_UNIT_ID, complianceAcceptability.getUnitId());
      contentValues.put(KEY_COMPLIANCE_ID, complianceAcceptability.getComplianceId());
      contentValues.put(KEY_COMPLIANCE_NAME, complianceAcceptability.getCompliancenName());
      contentValues.put(KEY_COMPLIANCE_FREQUENCY, complianceAcceptability.getComplianceFrequency());
      contentValues.put(KEY_COMPLIANCE_APPLICABLE, complianceAcceptability.getComplianceApplicable());
      contentValues.put(KEY_COMPLIANCE_OPTED, complianceAcceptability.getComplianceOpted());
  
      sqLiteDatabase.insert(TABLE_COMPLIANCE_ACCEPTABILITY, null, contentValues);
      sqLiteDatabase.close();
  }
  </code></pre>
  
  <p>Imm trying to access the values using the following code,</p>
  
  <pre><code>public List&lt;ComplianceAcceptability&gt; getAllAcceptability() {
  
          List&lt;ComplianceAcceptability&gt; complianceAcceptabilityList = new ArrayList&lt;&gt;();
  
          String selectQuery = "SELECT * FROM " + TABLE_COMPLIANCE_ACCEPTABILITY;
  
          SQLiteDatabase db = this.getWritableDatabase();
          Cursor cursor = db.rawQuery(selectQuery, null);
  
          if (cursor.moveToFirst()) {
              do {
                  ComplianceAcceptability complianceAcceptability = new ComplianceAcceptability();
  
                  complianceAcceptability.setId(Integer.parseInt(cursor.getString(0)));
                  complianceAcceptability.setCountryId(cursor.getString(1));
                  complianceAcceptability.setDomainId(cursor.getString(2));
                  complianceAcceptability.setUnitId(cursor.getString(3));
                  complianceAcceptability.setComplianceId(cursor.getString(4));
                  complianceAcceptability.setCompliancenName(cursor.getString(5));
                  complianceAcceptability.setComplianceFrequency(cursor.getString(6));
                  complianceAcceptability.setComplianceApplicable(cursor.getString(7));
                  complianceAcceptability.setComplianceOpted(cursor.getString(8));
  
              } while (cursor.moveToNext());
          }
  
          return complianceAcceptabilityList;
      }
  </code></pre>
  
  <p>The problem is that it returns an empty array. But when I try to print the contentValues within addComplianceStatus, it of course prints the array of all values.</p>