Implement loading of Images using ArrayAdapter
<p>I have the following objective:</p>

<p>I have a ListView , where each list item will contain an ImageView &amp; a TextView.</p>

<p>The ImageView data is fetched from an URL , so it will be lazily loaded .
I have already implemented the code my creating my own Adapter which extends the BaseAdapter &amp; overriden the method getView().</p>

<p>I am calling my own created Adapter from an Activity.</p>

<p>Kindly provide me hints/sample source code on how to implement the same using the ArrayAdapter since I now need to implement pagination of the listitems .
Whenever the no of listitems exceeds a specific value , a progressbar will start &amp; a webservice call will be made to fetch the response for the next set of listitems from the server which needs to be appended to the existing list.</p>

<p>I am providing the code which I have implemented using the BaseAdapter.
Kindly help.</p>

<pre><code>public class SampleListActivity extends Activity implements OnKeyListener {
CustomAdapter adap;

public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.list_structure);
    String imageStr[] = (String[]) listVec.toArray(new String[listVec
            .size()]);

    adap = new CustomAdapter (this, imageStr,listVec);
    setListAdapter(adap);
}
}

public class CustomAdapter extends BaseAdapter implements Filterable, OnClickListener {

int count = 0; 

private Activity activity; 

private String[] data; 

private LayoutInflater inflater = null; 

public ImageLoader imageLoader; 

public LazyListAdapter(Activity a, String[] d) { 
    activity = a; 
    data = d; 
    inflater = (LayoutInflater) activity 
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 

    imageLoader = new ImageLoader(activity.getApplicationContext()); 
} 

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

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

public long getItemId(int position) { 
    return position; 
} 
public class ViewHolder { 
    public TextView textTitle; 
    public ImageView image; 
    public ImageView addImage; 
} 
public View getView(final int position, View convertView, 
        ViewGroup parent) { 

    View vi = convertView;  
    ViewHolder holder; 

    if (vi == null) { 
        vi = inflater.inflate(R.layout.list_videos_content, null); 
        holder = new ViewHolder(); 
        holder.image = (ImageView) vi.findViewById(R.id.iconLine); 
        holder.textTitle = (TextView)  
        vi.findViewById(R.id.textLine);
        holder.addImage = (ImageView)  
        vi.findViewById(R.id.buttonLine);
        vi.setTag(holder); 

    } else holder = (ViewHolder) vi.getTag();

    String textStr =tempVec.elementAt(1) 
    holder.textTitle.setText(textStr); 

    // Icons bound to the rows. 
    // Bind the data efficiently with the holder. 
    holder.image.setTag(data[position]); 
    holder.addImage.setImageResource(R.id.buttonLine); 
    imageLoader.DisplayImage(data[position], activity, holder.image); 

    return vi; 
} 
} 

public Filter getFilter() { 
    return null; 
}  

public void onClick(View v) { 
    int i = v.getId(); 
} 
</code></pre>
