4

I have a fragment-based app that I'm trying to analyze using the Hierarchy Viewer. My problem is that the views I need to analyze are not showing up in the Viewer, though they are clearly present in the emulator.

I have a FragmentActivity that launched a Fragment. That fragment launched a FragmentDialog using FragmentDialog.show(getActivity().getSupportFragmentManager(), "token"). That FragmentDialog launched an AlertDialog using AlertDialog.show(). On the emulator the FragmentDialog is visible (full screen) and the AlertDialog is visible floating on top of it.

In the Hierarchy Viewer Windows pane my activity is listed. If I select that and load the view hierarchy, I get the view hierarchy of the Fragment (which is not currently visible on the emulator).

I note (see attached image) that in the Hierarchy Viewer Windows pane there are two blank lines immediately above my Activity. I suspect that these are related to my "missing" DialogFragment and AlertDialogs. Unfortunately I'm not allowed to select either of these blank lines to load their respective view hierarchies.

Any ideas how I can get names associated with these two windows or otherwise get Hierarchy Viewer to cooperate with displaying their contents?

(Additional background, if I use "Dump View Hierarchy" from the DDMS perspective the dump does include the DialogFragment and AlertDialogs. Unfortunately this tool does not provide the internal data (layout params) that I need to figure out what's going on.)

Android Device Monitor Screenshot

Emulator Screenshot

0 Answers0