# FragmentKt

Added in 2.4.0

*** ** * ** ***


```
public final class FragmentKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavController` | `https://developer.android.com/reference/androidx/navigation/fragment/FragmentKt#(androidx.fragment.app.Fragment).findNavController()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/fragment/app/Fragment receiver)` Find a `https://developer.android.com/reference/androidx/navigation/NavController` given a `https://developer.android.com/reference/androidx/fragment/app/Fragment` |

## Public methods

### findNavController

Artifact: [androidx.navigation:navigation-fragment](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/fragment/Fragment.kt+function:findNavController) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public static final @NonNull NavController findNavController(@NonNull Fragment receiver)
```

Find a `https://developer.android.com/reference/androidx/navigation/NavController` given a `https://developer.android.com/reference/androidx/fragment/app/Fragment`

Calling this on a Fragment that is not a `https://developer.android.com/reference/androidx/navigation/fragment/NavHostFragment` or within a `https://developer.android.com/reference/androidx/navigation/fragment/NavHostFragment` will result in an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html`