Ya está disponible la segunda Vista previa para desarrolladores de Android 11; pruébala y comparte tus comentarios.

DynamicNavHostFragment

open class DynamicNavHostFragment : NavHostFragment
kotlin.Any
   ↳ androidx.fragment.app.Fragment
   ↳ androidx.navigation.fragment.NavHostFragment
   ↳ androidx.navigation.dynamicfeatures.fragment.DynamicNavHostFragment

The NavHostFragment for dynamic features.

Summary

Public constructors

The NavHostFragment for dynamic features.

Protected methods

open SplitInstallManager

Create a new SplitInstallManager.

open Unit

Inherited functions

Inherited extension functions

From androidx.fragment.app
Lazy<VM>
Fragment.activityViewModels(noinline factoryProducer: () -> ViewModelProvider.Factory = null)

Returns a property delegate to access parent activity's ViewModel, if factoryProducer is specified then ViewModelProvider.Factory returned by it will be used to create ViewModel first time.

Lazy<VM>
Fragment.createViewModelLazy(viewModelClass: KClass<VM>, storeProducer: () -> ViewModelStore, factoryProducer: () -> ViewModelProvider.Factory = null)

Helper method for creation of ViewModelLazy, that resolves null passed as factoryProducer to default factory.

Lazy<VM>
Fragment.viewModels(noinline ownerProducer: () -> ViewModelStoreOwner = { this }, noinline factoryProducer: () -> ViewModelProvider.Factory = null)

Returns a property delegate to access ViewModel by default scoped to this Fragment:

From androidx.navigation
NavGraph
NavHost.createGraph(@IdRes id: Int = 0, @IdRes startDestination: Int, builder: NavGraphBuilder.() -> Unit)

Construct a new NavGraph

Lazy<VM>
Fragment.navGraphViewModels(@IdRes navGraphId: Int, noinline factoryProducer: () -> ViewModelProvider.Factory = null)

Returns a property delegate to access a ViewModel scoped to a navigation graph present on the {@link NavController} back stack:

From androidx.navigation.fragment
NavController

Find a NavController given a Fragment

NavArgsLazy<Args>

Returns a Lazy delegate to access the Fragment's arguments as an Args instance.

From androidx.activity.androidx.activity.result.ActivityResultCaller
() -> Unit
ActivityResultCaller.prepareCall(contract: ActivityResultContract<I, O>, input: I, registry: ActivityResultRegistry, crossinline callback: (O) -> Unit)

A version of ActivityResultCaller.prepareCall that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.

() -> Unit
ActivityResultCaller.prepareCall(contract: ActivityResultContract<I, O>, input: I, crossinline callback: (O) -> Unit)

A version of ActivityResultCaller.prepareCall that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.

From androidx.lifecycle
suspend T
LifecycleOwner.whenCreated(block: suspend CoroutineScope.() -> T)

Runs the given block when the LifecycleOwner's Lifecycle is at least in Lifecycle.State.CREATED state.

suspend T
LifecycleOwner.whenResumed(block: suspend CoroutineScope.() -> T)

Runs the given block when the LifecycleOwner's Lifecycle is at least in Lifecycle.State.RESUMED state.

suspend T
LifecycleOwner.whenStarted(block: suspend CoroutineScope.() -> T)

Runs the given block when the LifecycleOwner's Lifecycle is at least in Lifecycle.State.STARTED state.

Inherited extension properties

From androidx.lifecycle
LifecycleCoroutineScope

CoroutineScope tied to this LifecycleOwner's Lifecycle.

Public constructors

<init>

DynamicNavHostFragment()

The NavHostFragment for dynamic features.

Protected methods

createSplitInstallManager

protected open fun createSplitInstallManager(): SplitInstallManager

Create a new SplitInstallManager.

onCreateNavController

protected open fun onCreateNavController(navController: NavController): Unit