android - There is no Options on my list -


im trying set preferences there no options on list here code

<listpreference  android:title="list" android:key="list" android:summary= "this list choose from" android:entries="@array/list" android:entryvalues="@array/lvalues" /> 

here code array

<string-array name="list">     <item option="1"></item>     <item option="2"></item>     <item option="3"></item>     <item option="4"></item> </string-array> <string-array name="lvalues">     <item>1</item>     <item>2</item>     <item>3</item>     <item>4</item> </string-array> 

i want option 1 etc next thing

is trying do?

<string-array name="list">    <item>option 1</item>    <item>option 2</item>    <item>option 3</item>    <item>option 4</item> </string-array> <string-array name="lvalues">    <item>1</item>    <item>2</item>    <item>3</item>    <item>4</item> </string-array> 

string array

an array of strings can referenced application.

note: string array simple resource referenced using value provided in name attribute (not name of xml file). such, can combine string array resources other simple resources in 1 xml file, under 1 <resources> element.

elements

<string-array> defines array of strings. contains 1 or more elements.

attributes:

name

  • string. name array. name used resource id reference array.

<item>

  • a string, can include styling tags. value can reference string resource. must child of <string-array> element. beware must escape apostrophes , quotation marks.

no attributes.

this application code retrieves string array:

resources res = getresources(); string[] planets = res.getstringarray(r.array.planets_array); 

reference/source:
http://developer.android.com/guide/topics/resources/string-resource.html#stringarray


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -