I tried to get values from a column called LocationCode to define whether to display the shop names. However, there is an error said that there is no such column. There is no mistake in spellings.
And this is the code:
public List<String> getQuotes() {
List<String> list = new ArrayList<>();
Cursor cursor = database.rawQuery("SELECT ShopName,LocationCode FROM WhereToEat WHERE LocationCode = 'WhiteFarm' ", null);
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
list.add(cursor.getString(0));
cursor.moveToNext();
}
cursor.close();
return list;
}
Thank you.
Aucun commentaire:
Enregistrer un commentaire