lundi 6 avril 2015

always empty cursor is returned

The part of code that returns cursor is as follows



public Cursor getAllRecords() {
SharedPreferences pref = mContext.getSharedPreferences("lin", 0);
String a = pref.getString("KEY", null); // getting String
Log.d("test=====>", a);
SQLiteDatabase databaseX = getReadableDatabase();

return databaseX.rawQuery("SELECT * FROM " + TABLE_NAME + " WHERE " + HISTORY_COLUMN_NAME + " = '" + a + "'", null);

}

Aucun commentaire:

Enregistrer un commentaire