-1
私はこのクエリを試して、カーソルは常にNULLに戻ります。テーブルの "members"は1レコードあります、ありがとうございます。カーソルは常にnullを返します - 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;
}
write = dbhelper.getWritableDatabase(); –
'rawQuery()'はnullを返しません。問題をより詳しく説明してください。 – laalto