hackbod wrote: > The array syntax has been completely reworked for the next release. > At that point you can use a new <string-array> tag to make an array of > strings, just like the <string> tag makes string-only resources. For > now, if you put your numbers in quotes, it should work fine. > > On Apr 28, 3:21 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote: > >> There is a bug open about this >> already:http://code.google.com/p/android/issues/detail?id=500 >> >> I haven't looked at it so I don't know if it's really a bug, but at >> least we have a report :) >> >> >> >> On Mon, Apr 28, 2008 at 3:15 PM, Dan U. <[EMAIL PROTECTED]> wrote: >> >> >>> Interesting. But I wonder if it's an undocumented feature instead of a >>> bug. >>> >>> On Apr 28, 12:36 pm, 6real <[EMAIL PROTECTED]> wrote: >>> >>>> Here is the content of the file /res/values/array.xml : >>>> <?xml version="1.0" encoding="UTF-8"?> >>>> <resources> >>>> <array name="filter_values"> >>>> <item>1</item> >>>> <item>2</item> >>>> <item>3</item> >>>> <item>4</item> >>>> <item>5</item> >>>> <item>6</item> >>>> </array> >>>> </resources> >>>> >>>> The java code associated is : >>>> Spinner valMinSLot = (Spinner) >>>> findViewById(R.id.s1_filter_min_slot_val) >>>> >>>> ArrayAdapter<CharSequence> adapter = >>>> ArrayAdapter.createFromResource(this, R.array.filter_values, >>>> android.R.layout.simple_spinner_item); >>>> >>>> adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); >>>> valMinSLot.setAdapter(adapter); >>>> >>>> The values I have in my spinners are .... the path of the files >>>> present under res/drawable. It means a list of png files ! >>>> >>>> If in my array I add a character (such as "i") then the values in my >>>> spinner are correct (1i, 2i, ..Etc). >>>> >>>> I have this bug under : >>>> OS : windows XP family edition - SP2 >>>> >>>> JVM : java version "1.6.0_05" >>>> Java(TM) SE Runtime Environment (build 1.6.0_05-b13) >>>> Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing) >>>> >>>> SDK : android-sdk_m5-rc15_windows >>>> >>>> I hope this could help the community. >>>> >> -- >> Romain Guywww.curious-creature.org >> > > > > The Array Adapter is a Char Sequence "ArrayAdapter<CharSequence>" try this
<?xml version="1.0" encoding="UTF-8"?> <resources> <array name="filter_values"> <item>"1"</item> <item>"2"</item> <item>"3"</item> <item>"4"</item> <item>"5"</item> <item>"6"</item> </array> or look at a ArrayAdapter and try ArrayAdapter<Integer>" Peter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---