title: OnGlobalLayoutListener in ListView
body: <p>I want to be able to expand the rows in my ListView with an animation. Therefore I need to know the height of the view that is expanding. I'm using this in the <code>getView()</code> method of my <code>ArrayAdapter</code>:</p>
  
  <pre><code>mDetailsView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
  
      @Override
      public void onGlobalLayout() {
          mDetailsView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
  
          onClickListener.setHeight(mDetailsView.getHeight());
          mDetailsView.setVisibility(View.GONE);
      }
  });
  </code></pre>
  
  <p>This works fine for the rows that are visible on screen at start, but when I scroll down, the <code>onGlobalLayout</code> method doesn't get called for the rows that weren't visible at first.</p>
  
  <p>How can I get the height for those rows?</p>