Is there a way to define custom elements that are configurable within resource files and possible to store in arrays?
Maybe there is a better way to do this so here is what I want to do:
I want to define elements which I can store within an array to display, i.e. in a customized list view /adapter.
I want to be able to define the order within an array in an xml file and define the id of the elements as well as some text and optionally a drawable. Than I want to display them within a list view. When I select one of these elements I want the ID defined for this element to be the one defined by me.
I would like something like this but I am unable to find a way to get there, any ideas?
Using xml Syntax Highlighting
- <!-- within values -->
- <array name="myArray">
- <item type="myElement" android:id="@id/elem_1" android:text="some text" android:drawable="@drawable/img_1 />
- <item type="myElement" android:id="@id/elem_2" android:text="some text" android:drawable="@drawable/img_2 />
- <item type="myElement" android:id="@id/elem_2" android:text="some text" android:drawable="@drawable/img_2 />
- </array>
- <!-- whithin my layout only extra elements listed -->
- <MyListView listElements="@array/myArray />
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


