compat/src/main/java/androidx/core/view/WindowCompat.java
@SuppressWarnings("TypeParameterUnusedInFormals")
    @NonNull
    public static <T extends View> T requireViewById(@NonNull Window window, @IdRes int id) {
        // TODO: use and link to Window#requireViewById() directly, once available
        T view = window.findViewById(id);
        if (view == null) {
            throw new IllegalArgumentException("ID does not reference a View inside this Window");
        }
        return view;
    }
/**
     * Finds a view that was identified by the {@code android:id} XML attribute
     * that was processed in {@link android.app.Activity#onCreate}, or throws an
     * IllegalArgumentException if the ID is invalid, or there is no matching view in the hierarchy.
     * <p>
     * <strong>Note:</strong> In most cases -- depending on compiler support --
     * the resulting view is automatically cast to the target class type. If
     * the target class type is unconstrained, an explicit cast may be
     * necessary.
     *
     * @param id the ID to search for
     * @return a view with given ID
     * @see ViewCompat#requireViewById(View, int)
     * @see Window#findViewById(int)
     */
Finds a view that was identified by the  android:id XML attribute
that was processed in  android.app.Activity#onCreate, or throws an
IllegalArgumentException if the ID is invalid, or there is no matching view in the hierarchy.

Note: In most cases -- depending on compiler support
the resulting view is automatically cast to the target class type. If
the target class type is unconstrained, an explicit cast may be
necessary.

@param id the ID to search for
@return a view with given ID
@see ViewCompat#requireViewById(View, int)
@see Window#findViewById(int)
Finds a view that was identified by the android : id XML attribute that was processed in android . app . Activity#onCreate or throws an IllegalArgumentException if the ID is invalid or there is no matching view in the hierarchy . Note : In most cases -- depending on compiler support the resulting view is automatically cast to the target class type . If the target class type is unconstrained an explicit cast may be necessary . @param id the ID to search for @return a view with given ID @see ViewCompat#requireViewById ( View int ) @see Window#findViewById ( int )
@SuppressWarnings("TypeParameterUnusedInFormals")
    @NonNull
    public static <T extends View> T requireViewById(@NonNull Window window, @IdRes int id) {
        T view = window.findViewById(id);
        if (view == null) {
            throw new IllegalArgumentException("ID does not reference a View inside this Window");
        }
        return view;
    }
@ SuppressWarnings ( "TypeParameterUnusedInFormals" ) @ NonNull public static < T extends View > T requireViewById ( @ NonNull Window window , @ IdRes int id ) { T view = window . findViewById ( id ) ; if ( view == null ) { throw new IllegalArgumentException ( "ID does not reference a View inside this Window" ) ; } return view ; }
Finds a view that was identified by the {@code android:id} XML attribute
 that was processed in {@link android.app.Activity#onCreate}, or throws an
 IllegalArgumentException if the ID is invalid, or there is no matching view in the hierarchy.
Finds a view that was identified by the { @code android : id } XML attribute that was processed in { @link android . app . Activity#onCreate } or throws an IllegalArgumentException if the ID is invalid or there is no matching view in the hierarchy .
// TODO: use and link to Window#requireViewById() directly, once available