-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