I was following this tutorial <http://xjaphx.wordpress.com/2011/06/16/viewholder-pattern-caching-view-efficiently/>. however, it isnt working. Can you guys help me how to make this working? 

```
class Custom extends Activity {

 private ListView listview;
 private ArrayList mListItem;

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
        setContentView(R.layout.custom);

  listview = (ListView) findViewById(R.id.list_view);
  mListItem = ItemsDisplay.getItems(true);

  listview.setAdapter(new CustomListAdapter(this, R.id.list_view,mListItem));
 }

 static class ViewHolder {
        public TextView textView;
    }

    private class CustomListAdapter extends ArrayAdapter {
        private ArrayList mList; //--CloneChangeRequired
        private Context mContext;

        public CustomListAdapter(Context context, int textViewResourceId,
                ArrayList list) { //--CloneChangeRequired
            super(context, textViewResourceId, list);
            this.mList = list;
            this.mContext = context;
        }   

        public View getView(int position, View convertView, ViewGroup parent) {
            View view = convertView;

            final ToggleButton tb;

             System.out.println("position "+position+" mList.size"+mList.size());
             if (view == null) {

              LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              view = vi.inflate(R.layout.list_item_bn, null);
              ViewHolder holder = new ViewHolder();
              holder.textView = (TextView)convertView.findViewById(R.id.tv_name);
              view.setTag(holder);
             }

             ItemsDisplay listItem = (ItemsDisplay) mList.get(position);
             System.out.println("listItem.getName() " +listItem.getName());
                if (listItem != null) {

                 ViewHolder holder1 = (ViewHolder)view.getTag();
                 holder1.textView.setText(listItem.getName());

                }

            return view;  
        }

    }
}

```

i already looked into these posts, but im not sure why my code still isnt working.
[How to implement a view holder?](https://stackoverflow.com/questions/4145602/how-to-implement-a-view-holder)
[ListView with ArrayAdapter and ViewHolder adding icons to the wrong item](https://stackoverflow.com/questions/3123193/listview-with-arrayadapter-and-viewholder-adding-icons-to-the-wrong-item)