title: CursorIndexOutOfBoundsException Index 0 requested, with a size of 0
body: <p>I'm trying to get a text from a certain row of my database. For this, I made this function </p>
  
  <pre><code>public String getTranslation(long rowId) throws SQLException {    
      String str = null;
      Cursor mCursor = db.query(
          true, TABLE_LANGUAGE_FR, new String[] {
              KEY_ID_INTERFACE_TEXT, KEY_ITEM_NAME,KEY_FORM_LABEL_ID, KEY_FORM_RANK
          }, 
          KEY_FORM_LABEL_ID + "=" + rowId, null, null, null, null, null
      );
  
      if (mCursor != null) {
          mCursor.moveToFirst();
          str = mCursor.getString(mCursor.getColumnIndex(KEY_ITEM_NAME));
      }
      return str;
  }
  </code></pre>
  
  <p>and I call it like this :</p>
  
  <pre><code>db = new DbAdapter(this);
  db.createDatabase(); 
  db.openDataBase();
  String str = db.getTranslation(1706);
  </code></pre>
  
  <p>My table looks like this :</p>
  
  <p><img src="https://i.stack.imgur.com/TU6YL.png" alt="enter image description here"></p>
  
  <p>I get this error :</p>
  
  <pre><code>09:32:08.965    307 com.Orange  ERROR   AndroidRuntime  Caused by: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
  09:32:08.965    307 com.Orange  ERROR   AndroidRuntime      at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)
  09:32:08.965    307 com.Orange  ERROR   AndroidRuntime      at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:214)
  09:32:08.965    307 com.Orange  ERROR   AndroidRuntime      at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:41)
  09:32:08.965    307 com.Orange  ERROR   AndroidRuntime      at com.Orange.Database.DbAdapter.getTranslation(DbAdapter.java:141)
  09:32:08.965    307 com.Orange  ERROR   AndroidRuntime      at com.Orange.Authentication.onCreate(Authentication.java:32)
  </code></pre>
  
  <p>Why am I getting this error? What am I doing wrong here?</p>
  
  <p>Thanks in advance.</p>