title: OnPageChangeListener makes ViewPager laggy
body: <p>I'm having a problem with a ViewPager being laggy ONLY on some devices ONLY when i use the onPageSelected method of an OnPageChangeListener.</p>
  
  <p>This is the listener:</p>
  
  <pre><code>public class SelectorChangeListener implements ViewPager.OnPageChangeListener {
  
      @Override
      public void onPageScrolled(int i, float v, int i2) {}
  
      @Override
      public void onPageScrollStateChanged(int i) {}
  
      @Override
      public void onPageSelected(int i) {
          onLineSelected(mAdapter.getLinePalina(i));
      }
  }
  </code></pre>
  
  <p>This is the onLineSelected method:</p>
  
  <pre><code>/**
   * Called when a line becomes selected
   * @param linePalina LinePalina Object
   */
  public void onLineSelected(LinePalina linePalina) {
      if(D) Log.d(TAG, "Called: onLineSelected([linePalina])");
      Palina palina = linePalina.palina;
      Line line = linePalina.line;
      mHeaderText.setText(palina.getName());
  }
  </code></pre>
  
  <p>Inside the adapter this is the getLinePalina(int) method:</p>
  
  <pre><code>public LinesSelectorFragment.LinePalina getLinePalina(int position) {
      return mLines.get(position);
  }
  </code></pre>
  
  <p>mLines is a simple ArrayList of LinePalina objects.</p>
  
  <p>What could be the cause of this lags that disappears when i disable the OnPageChangeListener ?</p>
  
  <p><strong>EDIT</strong>:
  I tried to remove ANY lines from the OnPageChangeListener, so now it's empty, it's being added to the ViewPager like this:</p>
  
  <pre><code>pager.setOnPageChangeListener(new SelectorChangeListener());
  </code></pre>
  
  <p>And *<em>Even with an empty listener</em> the ViewPager is laggy on some devices (Galaxy Tab 2 7.0) While if i comment out that line:</p>
  
  <pre><code>//pager.setOnPageChangeListener(new SelectorChangeListener());
  </code></pre>
  
  <p>The viewpager works perfectly!!! HOW is this possible?</p>