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”]

android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">

About author

AndroidGuys
AndroidGuys 4627 posts

Founded on November 5, 2007, we've enjoyed bringing you the latest in Android news and rumors. Updated daily, we strive to deliver reviews, opinions, and updates on all things related to Android.

You might also like

News and Rumors

Gameloft Adds Ability To Re-Download Purchased Games

If you are a fan of Gameloft games, you will be happy to hear they just changed their DRM policy. Now what does this mean? Gameloft changing their DRM policy

News and Rumors

Google+ for Android gets updated, brings new and improved UI

Google+ for Android received a pretty significant update today. The UI has been revamped to reflect the changes coming with the release of Android 4.0 aka Ice Cream Sandwich. With

News and Rumors

At long last, the Nexus 5 is official

After spending much of 2013 in the rumor mill, the Nexus 5 is now a formally recognized device. If you’ve been following the Android space at all over the last