google-developer-training/android-kotlin-fundamentals-apps

Android Kotlin Fundamentals codelab:

youamar opened this issue · 3 comments

Android Kotlin Fundamentals: 03.2 Define navigation paths
https://developer.android.com/codelabs/kotlin-android-training-add-navigation#6

It appears that there is an inadvertent error in point 4 of task 7 (Change the Back button's destination). The image displays "gameWonFragment" instead of "gameFragment" for the "popUpTo" attribute.

Good morning, it doesn't always take me to the TitleFragment activity either, but when I win it takes me to the GameFragment activity, this code works as I want:
`

<fragment
    android:id="@+id/titleFragment"
    android:name="com.example.android.navigation.TitleFragment"
    android:label="fragment_title"
    tools:layout="@layout/fragment_title" >
    <action
        android:id="@+id/action_titleFragment_to_gameFragment"
        app:destination="@id/gameFragment" />
</fragment>
<fragment
    android:id="@+id/gameFragment"
    tools:layout="@layout/fragment_game"
    android:name="com.example.android.navigation.GameFragment"
    android:label="GameFragment" >
    <action
        android:id="@+id/action_gameFragment_to_gameOverFragment"
        app:destination="@id/gameOverFragment"
        app:popUpTo="@id/titleFragment"
        app:popUpToInclusive="false" />
    <action
        android:id="@+id/action_gameFragment_to_gameWonFragment"
        app:destination="@id/gameWonFragment"
        app:popUpTo="@id/titleFragment"
        app:popUpToInclusive="false" />
</fragment>
<fragment
    android:id="@+id/gameOverFragment"
    android:name="com.example.android.navigation.GameOverFragment"
    android:label="fragment_game_over"
    tools:layout="@layout/fragment_game_over" />
<fragment
    android:id="@+id/gameWonFragment"
    android:name="com.example.android.navigation.GameWonFragment"
    android:label="fragment_game_won"
    tools:layout="@layout/fragment_game_won" />

`

My point was simply letting you know there is a missmatch between what is asked
"Again, set popUpTo to gameFragment in the Attributes pane and select the popUpToInclusive checkbox."
and what the image shows, the image shows the "popUpTo" set to gameWonFragment rather than gameFragment like what is asked but the popUpToInclusive checkbox is correctly checked on the image tho, that's about it...

Hello! Thank you for your feedback. This codelab is out of date and no longer maintained. Instead, please refer to the Android Basics with Compose course for the latest recommended practices. If you are looking for content on Views, you can check out the Android Basics in Kotlin course.

For updated content on user interactivity, please visit Android Basics with Compose Unit 2 Pathway 2: Add a button to an app.