Unable to add the Pagination code in Android to the existing Listview which handles lazy loading of images
<p>Kindly provide me a sample code which will contain the following:</p>

<ol>
<li><code>ListView</code> in which each list items will have an image icon loaded from an url &amp; 2 textviews .
The image is to be lazily loaded.</li>
<li>Pagination in Android where when the user scrolls vertically &amp; go to the 20th item , a progress dialog will be displayed &amp; in the background a call to the <code>webeservice</code> is made to fetch the next set of list items.</li>
</ol>

<p>I have implemented the Lazy loading part but unable to implement the pagination code.
I got a suggestion to implement the EndlessWrapper class but I am unable to add the logic to the existing code for pagination.
Kindly provide the sample code/logic on how to implement the <code>Pagination</code> on the existing Customised ListView.</p>

<p>Here is the ListView code:</p>

<pre><code>public class LazyListAdapter 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() {
        // TODO Auto-generated method stub
        return null;
    }

    public void onClick(View v) {
        int i = v.getId();
        // TODO Auto-generated method stub
    }
</code></pre>
