Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
Safeargs generated directions do not work (Android)

I have such settings in the project:

apply plugin: 'androidx.navigation.safeargs'

ext.navigationVersion = "1.0.0-beta02"

classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"

implementation "android.arch.navigation:navigation-fragment-ktx:$navigationVersion" implementation "android.arch.navigation:navigation-ui-ktx:$navigationVersion"

nav_graph.xml:

<fragment
        android:id="@+id/loginFragment"
        android:name="com.terkacleaning.ui.login.LoginFragment"
        android:label="fragment_login"
        tools:layout="@layout/fragment_login">

        <action 
            android:id="@+id/action_loginFragment_to_homeFragment"
            app:destination="@id/homeFragment"
            app:exitAnim="@anim/slide_out_left"
            app:popExitAnim="@anim/slide_out_right"
            app:popUpTo="@id/loginFragment"
            app:popUpToInclusive="true" />

</fragment>

<fragment
        android:id="@+id/homeFragment"
        android:name="com.terkacleaning.ui.home.HomeFragment"
        android:label="fragment_home"
        tools:layout="@layout/fragment_home"/>

Methods are generated:

    LoginFragmentDirections.actionLoginFragmentToHomeFragment()

But these methods don't work

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

As per the Safe Args documentation, constructing a NavDirections object isn't enough - you need to pass it to navController.navigate():

navController.navigate(
    LoginFragmentDirections.actionLoginFragmentToHomeFragment())
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!