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 7922013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:48:24+00:00 2026-06-03T16:48:24+00:00

I thought I had this figured out, but I obviously don’t. In an Android

  • 0

I thought I had this figured out, but I obviously don’t.

In an Android App I’m making a spinner will change it’s contents based on a previous spinner’s selection. The listener works and the second spinner is changing, however there is a third spinner that is not getting its contents.

What I would like to achieve is something along the lines of:

if (spinner1.selection == "Acura") {
spinner2 = "Acura";
}

The string-arrays that I’m calling are integers in the R.java file so for Acura it would be: R.array.Acura

So my question would be:

How can I call the integer R.array.* dynamically based on a string.

I hope my question makes sense.

Cheers

  • 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-06-03T16:48:25+00:00Added an answer on June 3, 2026 at 4:48 pm

    Use the getIdentifier() method on your activity to look up the resource ID.

    For example:

    spinner2 = "Acura";
    int arrayResourceId = getResources().getIdentifier(spinner2, "array", getPackageName());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought I had this figured out but it turns out I'm just deleting
I thought I had this all figured out, but I'm hitting a brick wall.
I thought I had this figured out, but I'm running into an issue. I'm
I thought I had this all figured out, but now that I'm writing a
I thought I had this figured out, but I'm wanting to find all occurances
I asked this question previously and thought I had it figured out but it
I'm going to ask this question again,I thought I had figured it out but
I thought I had this figured out, but can't get it working correctly: All
I thought I had the whole list alias thing figured out, but then I
Alright, I thought I had this whole setTimeout thing perfect but I seem to

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.