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

The Archive Base Latest Questions

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

I have a problem. Currently i’m using Lazyloading to load images and data into

  • 0

I have a problem. Currently i’m using Lazyloading to load images and data into my listview using arraylist. However it only display the last item of the arraylist.

Below is the LazyLoading adapter class:

public class LazyAdapter extends BaseAdapter {

private Activity activity;
private ArrayList<Hashtable<String,String>> data;
private static LayoutInflater inflater=null;
public ImageLoader imageLoader; 

public LazyAdapter(Activity a, ArrayList<Hashtable<String,String>> d) {
    activity = a;
    data=d;
    inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    imageLoader=new ImageLoader(activity.getApplicationContext());
}

public int getCount() {
    return data.size();
}

public Object getItem(int position) {
    return position;
}

public long getItemId(int position) {
    return position;
}

public static class ViewHolder{
    public TextView title;
    public TextView author;
    public TextView format;
    public TextView call_number;
    public ImageView cover_image;

    public Button next;
    public Button previous;
}

public View getView(int position, View convertView, ViewGroup parent) {
    View vi=convertView;
    ViewHolder holder;
    if (convertView == null){
        vi = inflater.inflate(R.layout.search_result_display_list , null);
        holder=new ViewHolder();

        holder.next = (Button) vi.findViewById(R.id.next);
        holder.previous = (Button) vi.findViewById(R.id.previous);

        holder.title = (TextView) vi.findViewById(R.id.item_title);
        holder.author = (TextView) vi.findViewById(R.id.item_author);
        holder.format = (TextView) vi.findViewById(R.id.item_format);
        holder.call_number = (TextView) vi.findViewById(R.id.item_call_number);
        holder.cover_image=(ImageView) vi.findViewById(R.id.cover_image);
        vi.setTag(holder);
    }
    else {
        holder=(ViewHolder)vi.getTag();
        vi = convertView;
    }

    for(int i = 0; i < getCount(); i++) {
        holder.title.setText(data.get(i).get("title"));
        holder.author.setText(data.get(i).get("author"));
        holder.format.setText(data.get(i).get("format"));
        holder.call_number.setText(data.get(i).get("callNumber"));
        holder.cover_image.setTag(data.get(i).get("coverImage"));
        imageLoader.DisplayImage(data.get(i).get("coverImage"), activity, holder.cover_image);
    }
    return vi;
}

I’m thinking that the problem might actually be with my for-loop. Where it is being generated infinitely. But I don’t know where did I go wrong in typing this code. Please help.

  • 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-22T01:50:30+00:00Added an answer on May 22, 2026 at 1:50 am

    Remove the for loop and in place of i in data.get(i) use position

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

Sidebar

Related Questions

I have the following problem using subversion: I'm currently working on the trunk of
I have a problem. Currently, I set the textbox value during PageLoad. However, this
I am currently faced with a difficult sorting problem. I have a collection of
I am currently trying to learn C and I have come to a problem
I have this problem; I'm currently doing some modification on a web application that
My current problem is that I have a JFrame with a 2x2 GridLayout. And
Problem, there's no method: bool ChangePassword(string newPassword); You have to know the current password
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am

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.