title: android.database.CursorIndexOutOfBoundsException
body: <p>I am running the software but when i scroll with the listview, its showing ok, but after a while i get this error message:</p>
  
  <p>I am trying to display a cursor to a listview.</p>
  
  <p>My Adapter class:</p>
  
  <pre><code>  private class DBAdapter extends SimpleCursorAdapter {
          private LayoutInflater mInflater;
          private Cursor c;
          private Context context;
  </code></pre>
  
  <p>My Constructor</p>
  
  <pre><code>        public DBAdapter(Context context, int layout, Cursor c, String[] from, int[] to) {
              super(context, layout, c, from, to);
              this.c = c;
              this.context = context;
              mInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          }
  </code></pre>
  
  <p>getView Method</p>
  
  <pre><code>        @Override
          public View getView(int position, View convertView, ViewGroup parent) {
              ViewHolder holder = null; 
              if (convertView == null) {
                  holder = new ViewHolder();
                  convertView = mInflater.inflate(R.layout.match_item, null);
                  holder.tvHome = (TextView)convertView.findViewById(R.id.ll_home);
                  convertView.setTag(holder);
              } else {
                  holder = (ViewHolder)convertView.getTag();
              }
                  holder.tvHome.setText(c.getString(3)+"("+c.getString(6)+")");
                  c.moveToNext();
                  return convertView; 
          }
      }
  </code></pre>
  
  <p>Simple View Holder</p>
  
  <pre><code>    public static class ViewHolder {
          public TextView tvHome;
      }
  }
  </code></pre>
  
  <p>Adapter init</p>
  
  <pre><code>Cursor cur = dh.getAll();
      startManagingCursor(cur);
  
      String[] from = new String[] { "home" };
      int[] to = new int[] { R.id.ll_home};
  
      // Now create an array adapter and set it to display using our row
      DBAdapter matches = new DBAdapter(this,R.layout.match_item, cur, from, to);
      setListAdapter(matches);
  </code></pre>
  
  <p>Can anyone help me to solve this problem?I've searched everywhere but i could not find any solution</p>
  
  <p>Best regards,
  Nicos</p>