On Wed, Dec 3, 2008 at 9:31 AM, Mark Murphy <[EMAIL PROTECTED]> wrote:
> Most likely, your views are not yet laid out when you are calling > test(). Either delay your call to test() until the views are laid out > (e.g., onResume() might be late enough), or manually request a layout() > of your root view. I'm not sure what you mean by manually request a layout, but I think that is probably something I would recommend against. As a general rule, if you are trying to extract view width and height information outside of the normal layout flow, you are probably doing something wrong, and will break in various situations (such as if the system needs to resize your window for some reason, like say an input method being displayed). The view hierarchy is designed to drive layout, with callbacks into View and ViewGroup for the objects to work together as the layout changes. For things that depend on layout, you should hook there, so you can correctly handle any time layout changes. -- Dianne Hackborn Android framework engineer [EMAIL PROTECTED] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

