-1
我试过这个查询,并且游标一直返回NULL,在表“members”存在1条记录,谢谢。游标总是返回空 - SQLite
sql = "SELECT nick, pass FROM miembros LIMIT 1";
cursor = write.rawQuery(sql, null);
if (cursor != null){
if(cursor.moveToFirst()) {
nickDB = cursor.getString(0);
passDB = cursor.getString(1);
resp[0] = nickDB;
resp[1] = passDB;
}
// Cierra el cursor
if(!cursor.isClosed()) cursor.close();
}else{
Log.e("CURSOR","CURSOR NULL");
}
return resp;
}
写入= dbhelper.getWritableDatabase(); –
'rawQuery()'不会返回null。请更详细地解释你的问题。 – laalto