java - Spinner not a view that can be bounds(sp) by this SimpleCursorAdapter -
i'm trying adapt query spinner object trouble, error listed title. here code portion crashes:
spinner classdropdown = (spinner) this.findviewbyid(r.id.classdropdown); int[] = new int[] { r.id.classdropdown }; string[] classfields = new string[] { "classname" }; simplecursoradapter cursoradapter = new simplecursoradapter(this, r.layout.main, cursor, classfields, to); cursoradapter.setdropdownviewresource(r.id.classdropdown); classdropdown.setadapter(cursoradapter); i had problem cursor wasn't being filled fixed now. can give me on debugging issue?
edit: think problem "to" field. should be?
edit 2: also, here xml spinner object:
<spinner android:id="@+id/classdropdown" android:layout_width="match_parent" android:layout_height="wrap_content" /> edit 3: i've fixed above reflect fixing code. fixes particular problem. i'm not getting error, have nothing displayed in spinner.
to list of resource ids want put data into, such r.id.textview1, , meed contained in layout specify in adapter. number of elements should match number of elements in array ( called classfields).
so, have 2 pieces of data , specified 1 target resource id. either remove 1 of fields in classfields array or add widget layout , call.it in array , should work.
Comments
Post a Comment