i try to put some entries of my db into a spinner. i googled and found some code. my problem: it doesn't work for me.
Any ideas what i do wrong?
Cursor myCursor = myDB.rawQuery("SELECT _id, name FROM Car;", null);
startManagingCursor(myCursor);
myCursor.moveToFirst();
SimpleCursorAdapter spinneradapt = new SimpleCursorAdapter(
this,
android.R.layout.simple_spinner_item,
myCursor,
new String[] { "name" },
new int[] {android.R.id.text1});
spinneradapt.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spnName.setAdapter(spinneradapt);
i "toasted" (<- haha :D) the first entry of my db. it works fine. but there are no entries in my spinner..
Thanks,开发者_运维问答 Prexx
精彩评论