// My getBus Function
Cursor getBus(String source, String dest)
{
SQLiteDatabase db=this.getReadableDatabase();
Cursor cur=db.rawQuery("SELECT b.BusName FROM BusTable b, (SELECT Route , RBusName FROM RouteBusTable WHERE Route IN ("+source+")) b1, (SELECT Route , RBusName FROM RouteBusTable WHERE Route IN ("+dest+")) c WHERE b.BusName IN (b1.RBusName) AND b.BusName IN (c.RBusName)", new String [] {});
return cur;
}
// Retreiving it like this
Cursor a = dbHelper.getBus("1", "12");
a.moveToFirst();
while (!a.isAfterLast())
{
String Name = a.getString(0);
Toast.makeText(AddEmployee.this, "Stops Are "+ Name , Toast.LENGTH_LONG).show();
a.moveToNext();
}
It stops the app. What I doing wrong there?? Is there any mistake in subquery or retrieving??