title: Grid View begins lagging
body: <p>I'm trying to make a simple grid view that's displays a grid of images. However, something is making the app lag extremely bad. I get a bunch of warnings about frames being skipped, and that I might be doing too much work on the main thread, but I honestly don't know what I'm doing wrong. </p>
  
  <p><strong>My Adapter:</strong></p>
  
  <pre><code>public class HeaderListAdapter extends BaseAdapter {
      private List&lt;HeaderInfo&gt; headerList;
      private int HEADER_SIZE;
      private LayoutInflater layoutInflater;
  
  
      public HeaderListAdapter(Activity context, List&lt;HeaderInfo&gt; headerList) {
          this.headerList = headerList;
          HEADER_SIZE = (context.getResources().getDimensionPixelSize(R.dimen.storeItemSelect_HeaderHeight));
          layoutInflater = LayoutInflater.from(context);
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          final HeaderInfo headerInfo = (HeaderInfo) this.getItem(position);
  
          ViewHolder holder;
  
          if (convertView == null) {
              convertView = layoutInflater.inflate(R.layout.store_item_selection_header_card, null);
              holder = new ViewHolder(convertView);
              convertView.setTag(holder);
          } else {
              holder = (ViewHolder) convertView.getTag();
          }
  
          holder.headerImage.setImageDrawable(headerInfo.headerImage);
          holder.headerSpace.setVisibility(position == 0 || position == 1 
              ? View.VISIBLE 
              : View.GONE);
          holder.headerName.setText(headerInfo.headerName);
  
          return convertView;
      }
  
  public static class ViewHolder {
      public ImageView headerImage;
      public TextView headerName;
      public Space headerSpace;
  
      public ViewHolder(View v) {
          headerImage = (ImageView) v.findViewById(R.id.header_image);
          headerName = (TextView) v.findViewById(R.id.header_title);
          headerSpace = (Space) v.findViewById(R.id.headerSpace);
      }
  }
  
  public int Height() {
      return (HEADER_SIZE + 32) * Math.round(headerList.size() / 2);
  }
  </code></pre>
  
  <p><strong>My onCreate Activity:</strong></p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.store_item_selection_main);
  
      Intent intent = getIntent();
      storeName = intent.getStringExtra(EXTRA_STORE_NAME);
      toolbar = (Toolbar) findViewById(R.id.toolbar);
      backdrop = (ImageView) findViewById(R.id.backdrop);
      collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
      GridView testGridView = (GridView) findViewById(R.id.gridView);
  
      headerItems = _HelperFunctions.getTempHeaderDB(this);
      HeaderListAdapter expandableListAdapter = new HeaderListAdapter(this, headerItems);
      testGridView.getLayoutParams().height = getHeight(expandableListAdapter.Height());
      testGridView.setAdapter(expandableListAdapter);
      testGridView.setNumColumns(2);
  
      setupToolbar(toolbar, collapsingToolbar, storeName, backdrop);
  
      LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(this, R.anim.recent_layout_controller);
      testGridView.setLayoutAnimation(controller);
  }
  </code></pre>
  
  <p>note: the <code>getHeight()</code> method simply gets the right height to set the listview, and the <code>setupToolbar</code> just sets up my collapsible toolbar.</p>
  
  <p>If you need any more information let me know, and thanks for the help!</p>