try {
Fragment currentFragment = context.getCurrentFragment();
if (currentFragment != null) {
// Check the children of this fragment
currentFragment.visitChildren(visitor, null);
} else {
// This is not a fragmented layout so use the layout root
RuntimeDeviceLayout layout = context.getDeviceLayout();
layout.getRootFormat().visit(visitor, null);
}