I tried this to get the count of rows. But the program is hanging.
private int countbaglist()
{
int count = 0;
SQLiteDatabase db = datasource.getWritableDatabase();
Cursor cursor = db.rawQuery(
"select count(*) from shoplist where itemname=?",
new String[] { String.valueOf("itemname") });
while(cursor.moveToFirst())
{
count = cursor.getCount();
}
return count;
}