database class
public boolean Permissions(String modulename) {
int createable, updateable;
Cursor cursor = db.rawQuery("select * from " + "moduleDesc" + " where "
+ "name" + "='" + modulename + "'", null);
if (cursor.getCount() > 0);
{
createable = cursor.getInt(cursor.getColumnIndex("createable"));
updateable = cursor.getInt(cursor.getColumnIndex("updateable"));
cursor.close();
}
if ((createable == 1) && (updateable == 1)) {
return true;
} else {
return false;
}
}
the error that i am getting is cursorindexoutofbounds on createable cursor.getInt(cursor.getColumnIndex("createable"));
although cursor is having some value still it gives this error!!! thanx in advance
With proper cursor closing.