Layout Problems Redux: Hierarchy Viewer

In the previous Building ‘Droids post, we went through an exercise of figuring out what was going wrong with a RelativeLayout used as rows in a ListView. This exercise used “retro” diagnostic techniques, such as changing background colors, to see what’s going on.

Two commenters, including Romain Guy from the Android team, pointed out the Hierarchy Viewer tool that has been added to the 0.9 SDK. So, today, let’s see what this tool is all about and how it can help you make sense of your layouts as they are used.

To use the Hierarchy Viewer, you first need to fire up your emulator, install your application, launch your activity, and navigate to spot you wish to examine. For today’s demonstration, we’ll use a trivial activity, whose layout is shown below:

[sourcecode language=”xml”]



  1. be appealing to readers.• also ensure that…

    the contents that you put in are informative and useful to readers. crafting articles with quality topics will be writing for the readers as the main priority.• to make a finality of your objectives, you have to optimize your articles for…

Comments are closed.