title: Listview only displaying last item of arraylist
body: <p>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.</p>
  
  <p>Below is the LazyLoading adapter class:</p>
  
  <pre><code>public class LazyAdapter extends BaseAdapter {
  
  private Activity activity;
  private ArrayList&lt;Hashtable&lt;String,String&gt;&gt; data;
  private static LayoutInflater inflater=null;
  public ImageLoader imageLoader; 
  
  public LazyAdapter(Activity a, ArrayList&lt;Hashtable&lt;String,String&gt;&gt; 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 &lt; 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;
  }
  </code></pre>
  
  <p>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.</p>