Package 

Class NavigationViewTrackingStrategy

    • Method Summary

      Modifier and Type Method Description
      Unit onActivityStarted(Activity activity)
      Unit onActivityStopped(Activity activity)
      Unit onActivityPaused(Activity activity)
      Unit onDestinationChanged(NavController controller, NavDestination destination, Bundle arguments)
      final Unit startTracking() Starts tracking on current activity.
      final Unit stopTracking() Stops tracking current activity.
      • Methods inherited from class com.datadog.android.rum.tracking.NavigationViewTrackingStrategy

        onActivityCreated, onActivityDestroyed, onActivityResumed, onActivitySaveInstanceState, register, unregister
      • Methods inherited from class com.datadog.android.rum.tracking.ActivityLifecycleTrackingStrategy

        onActivityPostCreated, onActivityPostDestroyed, onActivityPostPaused, onActivityPostResumed, onActivityPostSaveInstanceState, onActivityPostStarted, onActivityPostStopped, onActivityPreCreated, onActivityPreDestroyed, onActivityPrePaused, onActivityPreResumed, onActivityPreSaveInstanceState, onActivityPreStarted, onActivityPreStopped
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NavigationViewTrackingStrategy

        NavigationViewTrackingStrategy(Integer navigationViewId, Boolean trackArguments, ComponentPredicate<NavDestination> componentPredicate)
        Parameters:
        navigationViewId - the id of the NavHost view within the hosting Activity.
        trackArguments - whether to track navigation arguments
        componentPredicate - the predicate to keep/discard/rename the tracked NavDestinations
    • Method Detail

      • startTracking

         final Unit startTracking()

        Starts tracking on current activity.

        This is automatically called when activity starts. If using static navigation setup, with navigation container in XML layout, there's no need to call it manually. However if using dynamic navigation setup where navigation controller is created programmatically, then this function must be called after navigation controller is injected into view hierarchy. Regardless of the usage, the function always relies on view ID provided with the constructor.

        If activity is stopped, the function will return immediately without starting tracking.

      • stopTracking

         final Unit stopTracking()

        Stops tracking current activity.

        This is automatically called when activity stops. If using static navigation setup, with navigation container in XML layout, there's no need to call it manually. Even with dynamic navigation setup where navigation controller is created programmatically, default behavior should be enough. But the function is here in case tracking needs to be managed outside of the default activity lifecycle. In this case note that it's possible to call startTracking and stopTracking multiple times in succession.

        If activity is stopped, the function will return immediately.