数据库类
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;
}
}
我得到的错误是可创建的 cursorindexoutofbounds cursor.getInt(cursor.getColumnIndex("createable"));
尽管光标有一些价值,但它仍然给出了这个错误!!!提前谢谢