NavUtils

public final class NavUtils


NavUtils provides helper functionality for applications implementing recommended Android UI navigation patterns. For information about recommended navigation patterns see Tasks and Back Stack from the developer guide and Navigation from the design guide.

Summary

Constants

static final String

Public constructors

Public methods

static @Nullable Intent

Obtain an Intent that will launch an explicit target activity specified by sourceActivity's PARENT_ACTIVITY element in the application's manifest.

static @Nullable Intent
getParentActivityIntent(
    @NonNull Context context,
    @NonNull Class<Object> sourceActivityClass
)

Obtain an Intent that will launch an explicit target activity specified by sourceActivityClass's PARENT_ACTIVITY element in the application's manifest.

static @Nullable Intent
getParentActivityIntent(
    @NonNull Context context,
    @NonNull ComponentName componentName
)

Obtain an Intent that will launch an explicit target activity specified by sourceActivityClass's PARENT_ACTIVITY element in the application's manifest.

static @Nullable String

Return the fully qualified class name of sourceActivity's parent activity as specified by a PARENT_ACTIVITY element within the activity element in the application's manifest.

static @Nullable String
getParentActivityName(
    @NonNull Context context,
    @NonNull ComponentName componentName
)

Return the fully qualified class name of a source activity's parent activity as specified by a PARENT_ACTIVITY element within the activity element in the application's manifest.

static void

Convenience method that is equivalent to calling navigateUpTo(sourceActivity, getParentActivityIntent (sourceActivity)).

static void
navigateUpTo(@NonNull Activity sourceActivity, @NonNull Intent upIntent)

Navigate from sourceActivity to the activity specified by upIntent, finishing sourceActivity in the process.

static boolean