ViewHolder in custom adapter of listview is not working in Android
<p>I am beginner to Android. Now I am  working with ListView with custom adapter. I read an article about using view holder in adapter. It is 15% faster. But when I use view holder, listview is showing nothing. </p>

<p>This is custom adapter before I using view holder</p>

<pre><code>public class PodcastListAdapter extends ArrayAdapter&lt;Podcast&gt; {
    private ArrayList&lt;Podcast&gt; values;
    private Context context;


    public PodcastListAdapter(Context pcontext,ArrayList&lt;Podcast&gt; pvalues)
    {
        super(pcontext,-1,pvalues);
        this.context = pcontext;
        this.values =pvalues;
    }

    @Override
    public View getView(final int position,View convertView,ViewGroup parent)
    {

        LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View rowView = inflater.inflate(R.layout.podcast_list_row,parent,false);
        TextView titleTv = (TextView)rowView.findViewById(R.id.row_title);
        TextView descriptionTv = (TextView)rowView.findViewById(R.id.row_description);
        TextView durationTv = (TextView)rowView.findViewById(R.id.row_duration);
        TextView fileSizeTv = (TextView)rowView.findViewById(R.id.row_file_size);
        titleTv.setText(values.get(position).getTitle());
        descriptionTv.setText(values.get(position).getDescription());
        durationTv.setText(values.get(position).getDuration());
        fileSizeTv.setText(String.valueOf(values.get(position).getFileSize()));
        Log.i("CALLED","CALLED");
        return rowView;
    }

}
</code></pre>

<p>It is working perfectly.</p>

<p>But when I use view holder like this in adapter</p>

<pre><code>public class PodcastListAdapter extends ArrayAdapter&lt;Podcast&gt; {
    private ArrayList&lt;Podcast&gt; values;
    private Context context;

    static class ViewHolder {
        public TextView titleTextView;
        public TextView descriptionTextView;
        public ImageView imageView;
        public TextView durationTextView;
        public TextView fileSizeTextView;
    }


    public PodcastListAdapter(Context pcontext,ArrayList&lt;Podcast&gt; pvalues)
    {
        super(pcontext,-1,pvalues);
        this.context = pcontext;
        this.values =pvalues;
    }

    @Override
    public View getView(final int position,View convertView,ViewGroup parent)
    {
        View rowView = convertView;

        if(rowView==null)
        {
            LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            rowView = layoutInflater.inflate(R.layout.podcast_list_row,null);

            ViewHolder viewHolder = new ViewHolder();
            viewHolder.descriptionTextView = (TextView)rowView.findViewById(R.id.row_description);
            viewHolder.titleTextView = (TextView)rowView.findViewById(R.id.row_title);
            viewHolder.durationTextView = (TextView)rowView.findViewById(R.id.row_duration);
            viewHolder.fileSizeTextView = (TextView)rowView.findViewById(R.id.row_file_size);
            viewHolder.imageView = (ImageView)rowView.findViewById(R.id.row_image);
            rowView.setTag(viewHolder);
        }
        ViewHolder holder = (ViewHolder) rowView.getTag();
        holder.titleTextView.setText(values.get(position).getTitle());
        holder.descriptionTextView.setText(values.get(position).getDescription());
        holder.durationTextView.setText(values.get(position).getDuration());
        holder.fileSizeTextView.setText(String.valueOf(values.get(position).getFileSize()));
        return rowView;

    }

}
</code></pre>

<p>My list view is not showing any data. What is wrong with my code?</p>

<h2>Update</h2>

<p>The <a href="http://stackoverflow.com/questions/35125216/cannot-update-listview-adapter-in-the-volley-request-listener-in-android">suggested duplicate question</a> is not about viewHolder.</p>