package com.yuyakaido.android.cardstackview.sample;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class CardAdapter extends ArrayAdapter<String> {

    public CardAdapter(Context context) {
        super(context, 0);
    }

    @Override
    public View getView(int position, View contentView, ViewGroup parent) {
        if (contentView == null) {
            contentView = View.inflate(getContext(), R.layout.item_card_stack, null);
        }

        TextView v = (TextView) (contentView.findViewById(R.id.item_card_stack_text));
        v.setText(getItem(position));

        return contentView;
    }

}


@@ -423,24 +423,52 @@
 p parent) %7B%0A
+        ViewHolder holder;%0A%0A
         if (
@@ -588,164 +588,468 @@
     
-%7D%0A%0A
     
-    TextView v = (TextView) (contentView.findViewById(R.id.item_card_stack_text));%0A        v.setText(getItem(position));%0A%0A        return contentView;
+holder = new ViewHolder(contentView);%0A            contentView.setTag(holder);%0A        %7D else %7B%0A            holder = (ViewHolder) contentView.getTag();%0A        %7D%0A%0A        holder.textView.setText(getItem(position));%0A%0A        return contentView;%0A    %7D%0A%0A    private static class ViewHolder %7B%0A        public TextView textView;%0A%0A        public ViewHolder(View view) %7B%0A            this.textView = (TextView) view.findViewById(R.id.item_card_stack_text);%0A        %7D
 %0A   

Use ViewHolder pattern in sample adapter