Does this not work for you?

listPreference.getEntry());


On Oct 2, 7:40 am, Neil <[email protected]> wrote:
> That's an idea, but it's messy.  I can't believe that the best way to
> solve this is to repeat that chunk of code everywhere you need it.  I
> could put it in some utility class, but I'm sure there must be a nice
> neat way of doing it.
>
> Neil
>
> On Oct 2, 4:02 pm, "Mark Murphy" <[email protected]> wrote:
>
> > > Actually I just repeated what I was trying to do and realised I
> > > phrased my question wrong.  What I meant was how do I get the selected
> > > (localised) value - the code I quoted gets the key as you'd expect.
>
> > Um, probably with minor difficulty. The only way off the top of my head I
> > can think of to do this is:
>
> > Step #1: Use getResources().getStringArray() to get the keys array
>
> > Step #2: Find the index of the desired key in that array
>
> > Step #3: Use getResources().getStringArray() to get the values array
>
> > Step #4: Use the index from step #2 to get the desired value
>
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to