title: android.database.CursorIndexOutOfBoundsException: Index 1 requested, with a size of 1
body: <p>// This is not working. It shows first record and stops after that. I want a loop that keep running even after the last record. I got your point that cursor starts form position 0.<br>
      //Code</p>
  
  <pre><code>cur=db.getData(position);
  
      switch(v.getId())
      {
  
      case R.id.next :
      { 
  
          if (cur != null &amp;&amp; cur.getCount()&gt; 0 &amp;&amp; position &lt; cur.getCount() &amp;&amp; position != cur.getCount()){
              cur.moveToPosition(position);
              textView1.setText(""+cur.getString(1));// Display Columns 
              position++;
              cur.moveToNext();
          }
  }
  </code></pre>
  
  <p>// I want a loop to display record number </p>
  
  <p>for next button
  eg:</p>
  
  <pre><code>1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 
  </code></pre>
  
  <p>back button
  eg:</p>
  
  <pre><code>5 4 3 2 1 5 4 3 2 1
  </code></pre>
  
  <p>random button
  eg:</p>
  
  <pre><code>3 4 5 1
  5 1 2 3
  4 5 1 2 
  </code></pre>