public static boolean walkViewTree(final View root, final Predicate<View> callback, @Nullable final Predicate<View> condition) {
        if ((condition == null || condition.test(root)) && !callback.test(root)) {
            return false;
        }
        if (root instanceof ViewGroup) {
            final ViewGroup vg = (ViewGroup) root;
            final int childCnt = vg.getChildCount();
            for (int i = 0; i < childCnt; i++) {
                if (!walkViewTree(vg.getChildAt(i), callback, condition)) {
                    return false;
                }
            }
        }
        return true;
    }
traverses a viewtree starting from "root". For each view satisfying "condition", the "callback" is called. If "callback" returns false, then treewalk is aborted
main/src/main/java/cgeo/geocaching/ui/ViewUtils.java