navigation/runtime/src/main/java/androidx/navigation/Navigation.java
@NonNull
    public static NavController findNavController(@NonNull View view) {
        NavController navController = findViewNavController(view);
        if (navController == null) {
            throw new IllegalStateException("View " + view + " does not have a NavController set");
        }
        return navController;
    }
/**
     * Find a {@link NavController} given a local {@link View}.
     *
     * <p>This method will locate the {@link NavController} associated with this view.
     * This is automatically populated for views that are managed by a {@link NavHost}
     * and is intended for use by various {@link android.view.View.OnClickListener listener}
     * interfaces.</p>
     *
     * @param view the view to search from
     * @return the locally scoped {@link NavController} to the given view
     * @throws IllegalStateException if the given view does not correspond with a
     * {@link NavHost} or is not within a NavHost.
     */
Find a  NavController given a local  View.
This method will locate the  NavController associated with this view.
This is automatically populated for views that are managed by a  NavHost
and is intended for use by various  android.view.View.OnClickListener listener
interfaces.

@param view the view to search from
@return the locally scoped  NavController to the given view
@throws IllegalStateException if the given view does not correspond with a
NavHost or is not within a NavHost.
Find a NavController given a local View . This method will locate the NavController associated with this view . This is automatically populated for views that are managed by a NavHost and is intended for use by various android . view . View . OnClickListener listener interfaces . @param view the view to search from @return the locally scoped NavController to the given view @throws IllegalStateException if the given view does not correspond with a NavHost or is not within a NavHost .
@NonNull
    public static NavController findNavController(@NonNull View view) {
        NavController navController = findViewNavController(view);
        if (navController == null) {
            throw new IllegalStateException("View " + view + " does not have a NavController set");
        }
        return navController;
    }
@ NonNull public static NavController findNavController ( @ NonNull View view ) { NavController navController = findViewNavController ( view ) ; if ( navController == null ) { throw new IllegalStateException ( "View " + view + " does not have a NavController set" ) ; } return navController ; }
Find a {@link NavController} given a local {@link View}.
Find a { @link NavController } given a local { @link View } .