0

I want to populate a Spinner element with a List of element. I don't want to store this information on database, but I want to insert this option in one resource file.

So I have insert this code on String.xml file:

   <string-array name="sports_array">
        <item>Shuttle Badminton</item>
        <item>Tennis</item>
        <item>FootBall</item>
        <item>Basket Ball</item>
        <item>Table Tennis</item>
        <item>Chess</item>
        <item>Hockey</item>
    </string-array>

Now this is not good because I should to have other information like this:

Code:1 Name: Tennis CodeSystem: 1000.150 Version: 1

At the end, I want to have also other information than at the Name.

It is possible?

jfalexvijay
  • 3,681
  • 7
  • 42
  • 68
bircastri
  • 2,169
  • 13
  • 50
  • 119
  • You can keep local json copy in assets . Read from assets in model and perform operation – Krishna May 13 '16 at 07:22
  • If you have a list of static objects you can create a class with all your data inside. – michoprogrammer May 13 '16 at 07:23
  • why you don't create an item like this Code:1 Name: Tennis CodeSystem: 1000.150 Version: 1 – Linh May 13 '16 at 07:26
  • I can't use that code, because, I must use the information and I wan't do a slip operation – bircastri May 13 '16 at 07:29
  • Possible duplicate of [TypeArray in Android - How to store custom objects in xml and retrieve them?](http://stackoverflow.com/questions/6774579/typearray-in-android-how-to-store-custom-objects-in-xml-and-retrieve-them) – Artem Mostyaev May 13 '16 at 09:15

0 Answers0