use of com.zhan_dui.dictionary.cursoradapters.SimpleWordAdapter in project little-bear-dictionary by daimajia.
the class SimpleWordsFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mDictionaryDB = new DictionaryDB(getActivity(), DictionaryDB.DB_NAME, null, DictionaryDB.DB_VERSION);
SQLiteDatabase sqLiteDatabase = mDictionaryDB.getReadableDatabase();
Cursor cursor = sqLiteDatabase.rawQuery("select * from `word` order by `_id` desc", null);
getListView().setAdapter(new SimpleWordAdapter(getActivity(), cursor));
sqLiteDatabase.close();
}
Aggregations