I’m new in Android. I’m trying to get a specific word from database (SQLite). But I couldn’t make where clause work. Where am I making mistake?
My code is it:
private String[] sutunlar = {"ingilizce","turkce"};
public void kelimeUret() {
SQLiteDatabase db = kelimeler.getReadableDatabase();
Cursor kayit = db.query("kelimeler", sutunlar, "ingilizce='hello'", null, null, null, null);
String sonuc = kayit.getString(0);
Toast.makeText(getApplicationContext(), sonuc, Toast.LENGTH_SHORT).show();
}
I can not get a result…
Call
kayit.moveToFirst()before callingkayit.getString(0).