Android Open Source - AndroidNative---HTTP-Call Lazy Adapter

From Project

Back to project page AndroidNative---HTTP-Call.


The source code is released under:

MIT License

If you think the Android project AndroidNative---HTTP-Call listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.mobmaxime.httprequest;
/*w  w  w .ja  v  a 2 s  .  com*/
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class LazyAdapter extends BaseAdapter {

  Context context;
  List<createRow> rowItems;

  public LazyAdapter(Context applicationContext, List<createRow> rowItems) {
    // TODO Auto-generated constructor stub
    this.context = applicationContext;
    this.rowItems = rowItems;

  public int getCount() {
    // TODO Auto-generated method stub
    return rowItems.size();

  public Object getItem(int position) {
    // TODO Auto-generated method stub
    return rowItems.get(position);

  public long getItemId(int position) {
    // TODO Auto-generated method stub
    return rowItems.indexOf(getItem(position));

  private class ViewHolder {
    TextView title;

  public View getView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub

    ViewHolder holder = null;
    LayoutInflater mInflater = (LayoutInflater) context

    if (convertView == null) {
      convertView = mInflater.inflate(R.layout.list_row, null);
      holder = new ViewHolder();
      holder.title = (TextView) convertView.findViewById(;

    } else {
      holder = (ViewHolder) convertView.getTag();
    createRow rowItem = (createRow) getItem(position);


    return convertView;


Java Source Code List