我有一个名为FindWord()
的方法,但它返回空对象。我的错在哪里?
public Word FindWord( String kelime, SQLiteDatabase db){
Word w= new Word();
Cursor c = db.rawQuery("SELECT * FROM Words WHERE Name = ?", new String[] {kelime});
if (c.moveToNext()){
w = new Word(c.getInt(c.getColumnIndex("Id"))
,c.getString(c.getColumnIndex("Name"))
,c.getString(c.getColumnIndex("Mean")));
}
return w;
}