I need to set a View's topMargin
by the Actionbar
height so it's visible under the Actionbar
. I do this in my onCreateOptionsMenu
, thinking the Actionbar
is drawn at that point. My app targets API 14 and above only.
Running an emulator with API 17, getHeight()
returns a good value of 96dp. But running the same code on an emulator with API 16, a height of zero is returned, likely because it hasn't been drawn yet.
Why would there be a difference between the two APIs?