NavDeepLinkBuilder

public final class NavDeepLinkBuilder


Class used to construct deep links to a particular destination in a NavGraph.

When this deep link is triggered:

  1. The task is cleared.

  2. The destination and all of its parents will be on the back stack.

  3. Calling NavController.navigateUp will navigate to the parent of the destination.

The parent of the destination is the start destination of the containing navigation graph. In the cases where the destination is the start destination of its containing navigation graph, the start destination of its grandparent is used.

You can construct an instance directly with NavDeepLinkBuilder or build one using an existing NavController via NavController.createDeepLink.

If the context passed in here is not an Activity, this method will use android.content.pm.PackageManager.getLaunchIntentForPackage as the default activity to launch, if available.

See also
setComponentName

Summary

Public constructors

Public methods

final @NonNull NavDeepLinkBuilder
addDestination(@IdRes int destId, Bundle args)

Add a new destination id to deep link to.

final @NonNull NavDeepLinkBuilder
addDestination(String route, Bundle args)

Add a new destination route to deep link to.

final @NonNull PendingIntent

Construct a PendingIntent to the deep link destination.

final @NonNull TaskStackBuilder

Construct the full task stack needed to deep link to the given destination.

final @NonNull NavDeepLinkBuilder

Set optional arguments to send onto every destination created by this deep link.

final @NonNull NavDeepLinkBuilder

Sets an explicit Activity to be started by the deep link created by this class.

final @NonNull NavDeepLinkBuilder

Sets an explicit Activity to be started by the deep link created by this class.

final @NonNull