title: how to programmatically get the height of a view with buttons on it?
body: <p>okay here's my issue I want to create a scroll view that fills down to a set of two buttons that are right at the bottom of the screen.  knowing i can't just set the scroll view to fill parent I thought I'd go and get the height of the linear layout with the buttons in it and then the height of the scroll view that I set to fill parent. then subtract one from the other and then reset the scroll view height. I figured out how to get and set the scroll view height. and I found a way to that works to measure all of the other views in the activity but with this one it always returns a zero and I'm at a loss as to how to get the height of it.</p>
  
  <pre><code>final LinearLayout tv = (LinearLayout)findViewById(R.id.thebuttons);
      ViewTreeObserver vto = tv.getViewTreeObserver();
      vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
          public void onGlobalLayout() {
              Integer grr = tv.getHeight();
              Log.e("the h", grr.toString());
              ViewTreeObserver obs = tv.getViewTreeObserver();
              obs.removeGlobalOnLayoutListener(this);
          }
      });
  </code></pre>
  
  <p>now if I set it to any of my other layouts I get the height of it as I expect but set it to this one and I get 0; and this is the one I'm trying to measure! I've also tried to measure the button directly to no avail</p>
  
  <pre><code>&lt;LinearLayout
   android:id="@+id/thebuttons"
   android:orientation="horizontal"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_gravity="center_horizontal"
   android:layout_marginTop="5sp"
  &gt;
  &lt;Button
      android:id="@+id/saveit"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Save" /&gt;
  &lt;Button
      android:id="@+id/clearit"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Save" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>