title: Android Performance issues with ViewHolder
body: <p>I'm creating some ViewHolders for my projects's ListViews, inside the viewholders i'm storing the views, ImageViews, TextViews and more.</p>
  
  <p>In the viewholder's class i created also methods to configure the views from the item's status, I.E:</p>
  
  <p>For a chat message list item, i'll have a viewholder with a textview for the message's sender, an imageview with his avatar, an imageview that contains images from App's Resources to identify the message as an Audio Message, Video Message, Text Message and so on.
  In the same ViewHolder i've got also methods like:</p>
  
  <pre><code>configureViewFromMessage(MessageSender sender, Message message)
  </code></pre>
  
  <p>that configures the avatar, sender name and message type from Sender and Message POJO models.</p>
  
  <p><strong>EDIT:</strong>
  I'm adding an example Adapter to explain this better.</p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup viewGroup) {
      ContactViewHolder cvh;
  
      if (convertView != null) {
          cvh = (ContactViewHolder) convertView.getTag();
      } else {
          convertView = InflateUtils.inflate(mContext, R.layout.contact_list_item);
          convertView = InflateUtils.inflate(mContext, R.layout.contact_list_item_container);
          cvh = new ContactViewHolder(innerView);
          convertView.setTag(cvh);
      }
  
      /* Getting message */
      Message message = getItem(position);
      MessageSender sender = message.getSender();
  
      /* View settings */
      cvh.configureViewFromMessage(sender, message, mContext);
          /* Context is used to reach App's Resources */
  
      return convertView;
  }
  </code></pre>
  
  <p>Questions are:</p>
  
  <ol>
  <li><strong>Having those methods (possibly many) inside a ViewHolder can cause performance issues?</strong></li>
  <li><strong>Should i keep in the ViewHolders only the strictly required fields and no methods?</strong></li>
  </ol>