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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:15:21+00:00 2026-05-26T09:15:21+00:00

I have several spinners that I have created a custom ArrayAdapter for so I

  • 0

I have several spinners that I have created a custom ArrayAdapter for so I can change the drop down menu look. I want to manipulate the view depending on what spinner the dropdown belongs to. I thought I would be able to do something like parent.getTag() but it is returning null.

The custom array adapter looks like:

class BackgroundColorAdapter extends ArrayAdapter<String> {
    BackgroundColorAdapter() {
        super(SettingsActivity.this, R.layout.settings_spinner_item, R.id.item_text, textColors);
    }

    public View getDropDownView (int position, View convertView, ViewGroup parent){
        View row=super.getView(position, convertView, parent);
        if(parent.getTag().equals("background"){
            //Do custom stuff here
        }
        return(row);
    }
}

and I’m setting the tag:

settingsSpinner.setTag("bg_color_spinner");
settingsSpinner.setAdapter(new BackgroundColorAdapter());

I think I’m confused how the view hierarchy works but it seems logical that the parent of the spinner drop down would be the spinner. Anyone know how I can find out what spinner the drop down belongs to in getDropDownView?

edit: made the settingsSpinner a single spinner instead of an array of spinners to make it less confusing

  • 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-26T09:15:21+00:00Added an answer on May 26, 2026 at 9:15 am

    Eventually got this to work, here is the code for example that changes the text font for each item in the drop down.

    class TextSizeAdapter extends ArrayAdapter<String> {
    
            TextSizeAdapter() {
                super(SettingsActivity.this, R.layout.settings_spinner_item, R.id.item_text, textSizes);
            }
    
            public View getDropDownView (int position, View convertView, ViewGroup parent){
    
                View row=super.getView(position, convertView, parent);
                TextView text = (TextView)row.findViewById(R.id.item_text);
                text.setTextSize(TypedValue.COMPLEX_UNIT_PX,appState.FONTSIZES[position]);
                RadioButton radio = (RadioButton)row.findViewById(R.id.item_radio);
                if(settingsSpinners[2].getSelectedItemPosition() == position){
                    radio.setChecked(true);
                }else{
                    radio.setChecked(false);
                }
    
                return(row);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several labels on my UIView that I want to change the properties
I have several images that I want to place in a windows form. The
I have several UIAlertViews that i want to display in a sequential order, and
I have several strings that are being combined to make a URI. I want
I have several LINQ queries that will churn records (up to a million) based
I have several hex-values that I try to write to a file. It seems
I have several classes that I serialize/deserialize, each with a number of properties, some
I have several hosts from which i want to do the same query. So
I have several LESS files that are all imported into one master file (styles.less).
I have several process writing to the same log file. How can I synchronize

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.