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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:06:34+00:00 2026-06-11T14:06:34+00:00

I’ve got a listview, and inside it, several listitems have spinners (the rest have

  • 0

I’ve got a listview, and inside it, several listitems have spinners (the rest have checkboxes). The problem is, every time I call spinner.setAdapter(ArrayAdapter);, the listview stutters. If I comment out that line in getView(), the listview works great, smooth as you could ask. With that line, listview stutters every time it hits a new list.

I’ve tried a few things to help this. At first, I thought it might be the operation of pulling a string array from R.array.somestringarray, so I loaded those string arrays into another array to have them already in memory before they were needed. That didn’t work. I then assumed that it was the actual creation of the adapter, since my code at the time looked like

    ArrayAdapter<String> spinAdapter = new ArrayAdapter<String>(ScoreCounter.this,android.R.layout.simple_spinner_dropdown_item, forAdapter);
    holder.spin.setAdapter(spinAdapter);

So I created all the created all the ArrayAdapters beforehand and stuck them in an array so my code looked like this:

    holder.spin.setAdapter(masterSpinAdapter[position]);

That still stutters. It seems the simple act of setting an ArrayAdapter causes the listview to lag. Here’s my whole getView():

@Override
    public View getView(int position, View convertView, ViewGroup parent){
        if(convertView==null){
            LayoutInflater inflator = ScoreCounter.this.getLayoutInflater();
            convertView = inflator.inflate(R.layout.spinner_item , parent, false);

            ViewHolder holder = new ViewHolder();
            holder.cbox = (CheckBox)convertView.findViewById(R.id.scoreCheck);
            holder.spin = (Spinner)convertView.findViewById(R.id.scoreSpinner);
            holder.missionTitle = (TextView)convertView.findViewById(R.id.missionTitle);
            holder.missionDescription = (TextView) convertView.findViewById(R.id.missionDescription);
            holder.checkListen = new checkListener();
            holder.itemListen = new itemListener();

            convertView.setTag(holder);
        }

        ViewHolder holder = (ViewHolder)convertView.getTag();

        if(position==1||position==2||position==5||position==6||position==13||position==15){
            holder.spin.setVisibility(0x00000004);
            holder.spin.setEnabled(false);
            holder.cbox.setVisibility(0);
            holder.cbox.setEnabled(true);

            holder.cbox.setChecked(shouldBeChecked[position]);

            holder.checkListen.setRow(position);

            holder.cbox.setOnClickListener(holder.checkListen);
        }else{
            holder.spin.setVisibility(0);
            holder.spin.setEnabled(true);
            holder.cbox.setVisibility(0x00000004);
            holder.cbox.setEnabled(false);
            holder.spin.setAdapter((ArrayAdapter)masterSpinAdapter[position]);

            holder.itemListen.setRosPos(position);

            holder.spin.setOnItemSelectedListener(holder.itemListen);
            holder.spin.setSelection(spinnerPosition[position]);
        }
        holder.missionTitle.setText(missions[position]);
        holder.missionDescription.setText(descriptions[position]);

        return convertView;
    }

I’m definitely not an expert on listviews, so I originally thought that I may have been doing too much logic in getView. However, if I simply comment out holder.spin.setAdapter(args), the listview is perfectly smooth with a bunch of useless spinners. I’ve seen spinners in listviews before. What can I do to prevent stutters while scrolling? I thought about pre-creating every spinner with adapter preset, but I don’t know how to bind a pre-made spinner object to a view ID.

I’d love some advice on this.

  • 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-11T14:06:35+00:00Added an answer on June 11, 2026 at 2:06 pm

    After a lot of testing, I found out that android is a lot slower to set an adapter that has a few long items than a lot of short ones. I have one spinner with the numbers -12 through 36, and it loads much faster than a spinner with a total of 30 characters in 3 items (not what I expected). I ended up just moving to buttons for the short lists with more characters per item. Unfortunate, I wish I knew why

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.