Android: databinding when using a ArrayAdapter: possible?
- by Peterdk
I need some simple databinding for a Spinner. I want to display 2 items for each dropdownitem.
So when the user clicks the spinner I get a list like:
-------------------
Name
123456
-------------------
Name
123456
-------------------
I understand this can be done when using a Cursor, according to the databinding info on android dev. Like:
SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,
R.layout.my_custom_spinner_item_layout,
cur,
new String[] {People.NAME, People.ID},
new int[] {android.R.id.text1, android.R.id.text2});
However, I don't get my data from a database, so I don't use a cursor, I use a ArrayAdapter. Unfortunately it looks like there is no support for databinding with this adapter.
Is there a way to do this?