Class Navigation

  • The Navigation object controls card navigation and can be used to manage a stack of cards.

  • Key methods include popCard(), popToNamedCard(), popToRoot() for removing cards, pushCard() for adding cards, and updateCard() for replacing the current card.

  • Most navigation methods return the Navigation object itself, allowing for method chaining.

  • The printJson() method is available for debugging purposes, providing the JSON representation of the object.

Navigation

A helper object that controls card navigation. See the card navigation guide for more details.

Methods

MethodReturn typeBrief description
popCard() Navigation Pops a card from the navigation stack.
popToNamedCard(cardName) Navigation Pops to the specified card by its card name.
popToRoot() Navigation Pops the card stack to the root card.
printJson() StringPrints the JSON representation of this object.
pushCard(card) Navigation Pushes the given card onto the stack.
updateCard(card) Navigation Does an in-place replacement of the current card.

Detailed documentation

popCard()

Pops a card from the navigation stack. Can be chained with other card navigation actions.

Return

Navigation — This object, for chaining.


popToNamedCard(cardName)

Pops to the specified card by its card name. Can be chained with other card navigation actions.

Parameters

NameTypeDescription
cardNameStringThe name of the card to navigate to.

Return

Navigation — This object, for chaining.


popToRoot()

Pops the card stack to the root card. Can be chained with other card navigation actions.

Return

Navigation — This object, for chaining.


printJson()

Prints the JSON representation of this object. This is for debugging only.

Return

String


pushCard(card)

Pushes the given card onto the stack. Can be chained with other card navigation actions.

Parameters

NameTypeDescription
cardCard A card to add to the stack.

Return

Navigation — This object, for chaining.


updateCard(card)

Does an in-place replacement of the current card. Can be chained with other card navigation actions.

Parameters

NameTypeDescription
cardCard A card to replace the current card with.

Return

Navigation — This object, for chaining.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月03日 UTC.