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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:34:48+00:00 2026-05-23T11:34:48+00:00

Made a custom list view that includes an Image, two text views and a

  • 0

Made a custom list view that includes an Image, two text views and a checkbox. I could identify the checkbox being checked/ unchecked, but the problem with this design is very slow scrolling. Will this get faster if I test it into the real device.

public class ListViewActivity extends ListActivity {

 protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    ArrayAdapter<Model> compositeAdapter = new CompositeAdapter(this,
            getModel());
    setListAdapter(compositeAdapter);
    ListView lv = getListView();
    lv.setFastScrollEnabled(true);
   }
}

private class CompositeAdapter extends ArrayAdapter<Model> {
    private final List<Model> list;
    private final Activity context;

    public CompositeAdapter(Activity context, List<Model> list) {
        super(context, R.layout.listviewactivitylayout, list);
        this.context = context;
        this.list = list;
    }

    private class ViewHolder{
        protected TextView textView1;
        protected TextView textView2;
        protected ImageView imageView;
        protected CheckBox ckBox;
    }
    public View getView (int position, View convertView, ViewGroup parent) {
        View view = null;
        final ViewHolder vh;
        if(convertView==null){
            LayoutInflater li = context.getLayoutInflater();
            view = li.inflate(R.layout.listviewactivitylayout, null);
             vh = new ViewHolder();
            vh.ckBox =(CheckBox) view.findViewById(R.id.list_view_layout_checkbox);
            vh.imageView = (ImageView) view.findViewById(R.id.listView_image_view);
            vh.textView1 = (TextView)view.findViewById(R.id.list_view_layout_text_view1);
            vh.textView2= (TextView)view.findViewById(R.id.list_view_text_view2);
            view.setTag(vh);
        }
        else{
            view= convertView;
            vh = (ViewHolder)view.getTag();
        }

/**
** sending text and images to the each of the list view
**
*/
  • 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-23T11:34:49+00:00Added an answer on May 23, 2026 at 11:34 am

    You are loading images. that needs to be handled in a seperate thread and just placed on an imageView when it is decoded.

    here is a excelent project that will help you do that.
    Lazy load images

    EDIT

    by looking at your code there are few things i am noticing:

    First: there isnt any place you are asigning a picture. (use the lazy loading adapter for that)

    Second: your checkbox selections will get messed up. you need to keep track of the checked position with state and redraw in getView (hashmap or even better a sparse array for that)

    Third is to get rid of the helper view you are using. you don’t need it. (it is market as View view in your code).

    So, if convertView==null just use convertView=inflate... and return that one at the end.

    And Fourth as a useful tip: move the adapter class to a new class java file. you are already keeping the activity reference and the list, you can reduce the amount of code in your activity.

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

Sidebar

Related Questions

I'm working on application where I have a custom made List View, with image
I'm working on a custom dropdown that I made, just wondering if I could
I have a list view with custom adapter, with an Image Button and a
I've created a custom list, and made some changes to the way the CQWP
I made a custom control that is basically a multiline TextBox that allows input,
I made a custom handler that derives from MvcHandler. I have my routes using
I've made a custom DataGridViewCell that displays a custom control instead of the cell;
I want to create a list view custom like this link : http://sites.google.com/site/androideyecontact/_/rsrc/1238086823282/Home/android-eye-contact-lite/eye_contact-list_view_3.png?height=420&width=279 so
This one is weird. I have a list view that is a part of
I made a custom styled list in WPF: <DataTemplate x:Key=SelectedTemplate> <StackPanel Background=#FF4E4E4E HorizontalAlignment=Stretch> <TextBlock

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.