1

I am trying to navingate from GameFragment to GameWonFragment using Safe Args. But GameFragmentDirections class didn't generated.

 <fragment
    android:id="@+id/gameFragment"
    android:name="com.example.trivia.GameFragment"
    android:label="@string/android_trivia"
    tools:layout="@layout/fragment_game"
    >
    <action
        android:id="@+id/action_gameFragment_to_gameWonFragment"
        app:destination="@id/gameWonFragment"
        app:popUpTo="@id/gameFragment"
        app:popUpToInclusive="true" />
    <action
        android:id="@+id/action_gameFragment_to_gameOverFragment"
        app:destination="@id/gameOverFragment"
        app:popUpTo="@id/gameFragment" />
</fragment>

Project Module Gradle

navigation_version = "2.3.0-alpha04"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version"

App Gradle

apply plugin: "androidx.navigation.safeargs"
AndroidSam27
  • 238
  • 2
  • 11

0 Answers0