title: Cursor Index Out of Bounds Exception: Index -1 requested with size 0
body: <p>I am just trying to search for the data in multiple table.If the where condition data is not present in first table(tab1) then it has to search in the second table(tab2) but I am getting the exception showing that</p>
  
  <blockquote>
    <p>Cursor Index Out of Bounds Exception: Index -1 requested with size 0</p>
  </blockquote>
  
  <p>Here is my code</p>
  
  <pre><code>SQLiteDatabase db=openOrCreateDatabase("train",SQLiteDatabase.CREATE_IF_NECESSARY, null);
  Cursor c1;
  String[] table={"tab1","tab2","tab3","tab4"};
  int i=0;
  do {
     c1 = db.rawQuery("select * from '"+table[i]+"' where name='Triplicane'", null);
  i++;    
  
  } while(c1 == null);
  
  int id1=c1.getInt(0);
  String nam1=c1.getString(1);
  Toast.makeText(fare.this,"ID no:"+id1, Toast.LENGTH_LONG).show();       
  Toast.makeText(fare.this,"name"+nam1, Toast.LENGTH_LONG).show();
  </code></pre>