Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

NavType.EnumType

public static final class NavType.EnumType
extends SerializableType<D extends Enum>

java.lang.Object
   ↳ androidx.navigation.NavType<D extends java.io.Serializable>
     ↳ androidx.navigation.NavType.SerializableType<D extends java.lang.Enum>
       ↳ androidx.navigation.NavType.EnumType<D extends java.lang.Enum>


EnumType is used for NavArguments holding enum values.

Null values are not supported. To specify a default value in a Navigation XML file, simply use the enum constant without the class name, e.g. `app:defaultValue="MONDAY"`.

Summary

Inherited fields

Public constructors

EnumType(Class<D> type)

Constructs a NavType that supports a given Enum type.

Public methods

String getName()

Returns the name of this type.

D parseValue(String value)

Parse a value of this type from a String.

Inherited methods

Public constructors

EnumType

public EnumType (Class<D> type)

Constructs a NavType that supports a given Enum type.

Parameters
type Class: class that is an Enum

Public methods

getName

public String getName ()

Returns the name of this type.

This is the same value that is used in Navigation XML argType attribute.

Returns
String name of this type

parseValue

public D parseValue (String value)

Parse a value of this type from a String.

Parameters
value String: string representation of a value of this type

Returns
D parsed value of the type represented by this NavType