Skip to content

Instantly share code, notes, and snippets.

@olivierperez
Last active January 5, 2016 08:53
Show Gist options
  • Save olivierperez/315b0b2dc682bbaf1d6a to your computer and use it in GitHub Desktop.
Save olivierperez/315b0b2dc682bbaf1d6a to your computer and use it in GitHub Desktop.
private void debug(int level, ViewGroup view) {
for (int childIndex = 0; childIndex < view.getChildCount(); childIndex++) {
View child = view.getChildAt(childIndex);
String tab = "";
for (int x = 0; x < level; x++) {
tab += " ";
}
Log.d("XXXXXXXXXXX", tab + child.getClass() + " | " + child.getId());
if (child instanceof ViewGroup) {
debug(level + 1, (ViewGroup) child);
}
Log.d("XXXXXXXXXXX", tab + "! " + child.getClass());
}
}
/* From Activity
debug(0, (ViewGroup) findViewById(android.R.id.content));
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment