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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:42:22+00:00 2026-05-29T07:42:22+00:00

I am currently working on a ListView that contains around 80 to 100 items

  • 0

I am currently working on a ListView that contains around 80 to 100 items (TextViews). I don’t think it is too much content, but when i scroll (with fingers) the ListView is bobbing or laging. However, when I use the “fast-scroll-button” – that thing on the right of the ListView – the scrolling appears very consistent and smooth.

Did anyone have the same problem? I tested the ListView on my HTC Sensation.

Here is my ListView code:

<ListView
     android:id="@+id/list_view"
     android:layout_height="match_parent"
     android:layout_width="match_parent"
     android:scrollingCache="true">

</ListView>

And the Java code:

adptr = new ArrayAdapter<String>(iF, R.layout.list_item, showing) {

        @Override
        public View getView(int position, View convertView, ViewGroup grp) {

            LinearLayout lin = new LinearLayout(this.getContext());
            lin.setOrientation(LinearLayout.HORIZONTAL);

            // Icon
            ImageView v = new ImageView(this.getContext());
            // v.setBackgroundDrawable(iF.getResources().getDrawable(R.drawable.cube_icon));

            // Text
            TextView txt = new TextView(this.getContext());
            txt.setTextSize(Float.valueOf(prefs.getString("pref_txtSize", "12")));
            txt.setPadding(10, 10, 10, 10);
            txt.setText(this.getItem(position));
            txt.setTextColor(getLineColor(position));

            // Shortcut
            LinearLayout shortLin = new LinearLayout(this.getContext());
            shortLin.setGravity(Gravity.RIGHT);

            LayoutParams par = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
            shortLin.setLayoutParams(par);

            TextView s = new TextView(this.getContext());
            s.setTextSize(Float.valueOf(prefs.getString("pref_txtSize", "12")));
            s.setWidth(iF.getResources().getDimensionPixelSize(R.dimen.shortcutWidth));
            s.setPadding(10, 10, 10, 10);

            s.setText(getShortcut(position));

            shortLin.addView(s);

            // Return
            txt.invalidate();
            v.invalidate();
            s.invalidate();

            lin.addView(v);
            lin.addView(txt);
            lin.addView(shortLin);

            return lin;
        }
    };

As you can see, I made a customized ListView. The ArrayAdapter will be added in a different method (not shown here).

Thanks in advance

Adrian

  • 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-29T07:42:23+00:00Added an answer on May 29, 2026 at 7:42 am

    Do you remember about cache?

        public View getView(int position, View convertView, ViewGroup parent) {
    
        View view = convertView;
        ViewHolder holder;
    
        if (view == null) {
    
            LayoutInflater inflater = (LayoutInflater) context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            view = inflater
                    .inflate(R.layout.list_view_home_item, parent, false);
    
            holder = new ViewHolder();
            holder.title = (TextView) view
                    .findViewById(R.id.textView);
    
            holder.title.setText("blah");
            view.setTag(holder);            
        } else {        
            holder = (ViewHolder) view.getTag();
        }
    
        return view;
    

    and

        static class ViewHolder {
        TextView title;
    }
    

    ?

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

Sidebar

Related Questions

I'm working on an app that currently just uses a listview for a menu,
I am currently working on an Android project. I am using a ListView and
I am currently implementing a ListView populated with CheckedTextViews and have everything working just
Currently working with converting SQLException error messages into messages that are more useful for
Im currently working on a game that uses multi touch to apply zoom to
im currently working on a project that involves listing contacts with a photo and
I'm working on a project that has an ExpandableListView nested inside a regular ListView
I'm working on a layout where I use a ListView with RelativeLayout line items.
I have a layout with a ListView that contains EditText objects that can requestFocus()
I am currently working on a project that involves creating a questionnaire from a

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.