title: Sqlite Insert Runs Successfully But Does Have not any Effect On Database?
body: <p>I am trying to add a single row to my table. It seems like it works just fine, but the row is not added to database. When i check the database there is no change on it.</p>
  
  <p>I am trying to add it with insert method that SqliteDatabase provides with folowing code.</p>
  
  <pre class="lang-java prettyprint-override"><code>public void saveToCache(String word) {
      ContentValues contentValues = new ContentValues();
      contentValues.put("word", word);
      long value = database.insert("CACHE",null, contentValues);
  
      //The code below is for debug purposes, to see the if values are added
      //But when executed it gives 
      //android.database.CursorIndexOutOfBoundsException: Index -1 requested, 
      //with a size of 13
      Cursor cursor = database.rawQuery("SELECT * FROM CACHE",null);
          for(int i=0; i&lt; cursor.getCount();i++){
              String a = cursor.getString(0); //This is where the exception above happens
  
          }
  }
  </code></pre>
  
  <p>The value attribute seems right, everytime I use the function, it increments by 1. But the rawQuery method below gives the error I have provided in the comment.</p>
  
  <p>p.s : The table "CACHE" has only one COLUMN called word.</p>