@ SuppressWarnings ( "deprecation" ) public static void removeOnGlobalLayoutListener ( @ NonNull final ViewTreeObserver observer , @ Nullable final OnGlobalLayoutListener listener ) { Condition . INSTANCE . ensureNotNull ( observer , "The view tree observer may not be null" ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) { observer . removeOnGlobalLayoutListener ( listener ) ; } else { observer . removeGlobalOnLayoutListener ( listener ) ; } }
Removes a previous registered global layout listener from a view tree observer . Depending on the device s API level different methods are used for removing the listener .