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 4641 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

Walmart’s Black Friday features $69 Galaxy Prevail (Boost Mobile)

Purchase a smartphone on contract and receive $100 Walmart gift card.

News and Rumors

Comparing the Nexus 7 to the iPad mini

Well, it’s official.  Apple has a 7.9-inch iPad mini coming in the next few weeks and it cost $329 or more.  Hide yo kids, hide you wives, this thing is

News and Rumors

T-Mobile’s Uncarrier 7.0 plan is here, check it out before the 23rd!

Today is the day! T-Mobile’s new Wi-Fi CellSpots are available in stores, and the other facets of their Uncarrier 7.0 plan are in full effect! T-Mobile – Canton, OH After