Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6586129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:45:03+00:00 2026-05-25T16:45:03+00:00

Imagine an app that has a spinner menu with values 1,2,3,4 etc, but in

  • 0

Imagine an app that has a spinner menu with values 1,2,3,4 etc, but in text. In HTML you’d specify both the value, and the displayed text:

1 One

2 Two

3 Three

etc, and you can then make the interface pleasing to users, but easy for the app to extract the value (e.g. 3, not Three)

I need a drop-down menu in an Android app that shows text equivalents of numeric values. How do I display the right text, but then easily extract the right value behind it? I don’t want to use the position, as that is prone to bugs if the contents are changed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:45:04+00:00Added an answer on May 25, 2026 at 4:45 pm

    create two List object one contain the display value and another contain the actual value for e.g.

    List<String> disp_list = new ArrayList<String>();
    
    disp_list contains [one, two, three]
    
    List<String> actual_list = new ArrayList<String>();
    
    actual_list contains [1,2,3]
    

    now when user select get the position value on change listener of spinner and get the actual value form the actual_list

    select in spinner is “two” and it’s index value is 1;

    String sel = "";
    

    for e.g.

    spinner.setOnItemClickListener(new OnItemClickListener() {
    
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int index, long position) {
    // TODO Auto-generated method stub
         sel = actual_list.get(index);
    }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine you have an app that manages some library and has its own data.
I'm passing my Rails controller a parameter that has a value of: time =
Imagine an iPhone app with 30 classes. Every class has to interact with every
I am working on an app that has 12 localizations of about 16 XIBs.
I'm working on a app that has a paging UIScrollView that contains three scrollViews
Imagine an application that has a number of buttons it is displaying to the
I am working on an app that has a homescreen. This homescreen should behave
I've written a C++ app that has to process a lot of data. Using
I am working on a basic app that has a public facing form (for
Imagine that I have a engine gem A that has your application.css and application.js

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.