Method For Spinner Item Click Listener With Simplecursoradapter And Viewbinder
Solution 1:
What you should do is implement an OnItemSelectedListener. In the listener, when ever an item is selected save that item to some sort of variable you can access after the spinner is closed.
Solution 2:
here we go:
its neccessary to set adapter.setDropDownViewResource(R.layout.spinner_row);
the DropDownView defines the look of the DropDownView and the layout defined in the SimpleCursorAdapter constructor defines the layout of the items of the (closed) spinner object itself (not its drop down view!).
so, its nice to have a different layout for the DropDownView which is exacly like the one defined in the SimpleCursorAdapter so the values pushed to it can be set to the right corresponding fields except with the difference that i use android:layout_height="?android:attr/listPreferredItemHeight"
for the textview of the dropdownview layout and android:layout_height="wrap_content" for the textview of the spinner layout!
Post a Comment for "Method For Spinner Item Click Listener With Simplecursoradapter And Viewbinder"