android-safe-args

Issue with Navigation Component Duplicate NavArgs

百般思念 提交于 2021-02-07 04:16:30
问题 I have a fragment: class SomeFragment { private val args by navArgs<SomeFragmentArgs>() } this fragment is used in two navigation graph: first_nav.xml .... <fragment android:id="@+id/initialFragment" android:name="com.example.InitialFragment" android:label="Initial Fragment"> <action android:id="@+id/action_to_some_fragment" app:destination="@id/someFragment" /> </fragment> <fragment android:id="@+id/someFragment" android:name="com.example.SomeFragment" android:label="Some Label"> <argument

Issue with Navigation Component Duplicate NavArgs

倾然丶 夕夏残阳落幕 提交于 2021-02-07 04:14:45
问题 I have a fragment: class SomeFragment { private val args by navArgs<SomeFragmentArgs>() } this fragment is used in two navigation graph: first_nav.xml .... <fragment android:id="@+id/initialFragment" android:name="com.example.InitialFragment" android:label="Initial Fragment"> <action android:id="@+id/action_to_some_fragment" app:destination="@id/someFragment" /> </fragment> <fragment android:id="@+id/someFragment" android:name="com.example.SomeFragment" android:label="Some Label"> <argument

FragmentDirections was not generate by Safe Args plugin

折月煮酒 提交于 2020-04-18 12:21:10
问题 When I trying to use Safe Args plugin to jump from one fragment to another, the compiler shows "Unresolved reference: VideoFragmentDirections". I have already set the classpath and dependency for safe args and VideoFragmentArgs was generated correctly. kotlin_version = '1.3.50' navigation-safe-args-gradle-plugin:2.1.0 In my xml <fragment android:id="@+id/nav_home" android:name="example.ui.home.HomeFragment" android:label="@string/menu_home" tools:layout="@layout/fragment_home" > <action

Pass data/bundle using navigateUp in Android Navigation Component

狂风中的少年 提交于 2020-01-11 05:15:08
问题 I found the question but does not have solution in code I want to have data when backpress/manual back happens. I am using navigateUp() to go back. How can I pass data to previous fragment? navigateUp() does not have any facility to pass data to previous fragment. Even I did not find solution using Safe Args. It's passing data forward. I want to have in backward Frad B -> Frag A. My code to go back to previous fragment Navigation.findNavController(view).navigateUp() My question is, How can i

Pass data/bundle using navigateUp in Android Navigation Component

拈花ヽ惹草 提交于 2020-01-11 05:15:07
问题 I found the question but does not have solution in code I want to have data when backpress/manual back happens. I am using navigateUp() to go back. How can I pass data to previous fragment? navigateUp() does not have any facility to pass data to previous fragment. Even I did not find solution using Safe Args. It's passing data forward. I want to have in backward Frad B -> Frag A. My code to go back to previous fragment Navigation.findNavController(view).navigateUp() My question is, How can i

Can't get Root View from Data Binding after enabling safe-args plugin

允我心安 提交于 2019-12-19 08:12:53
问题 I'm working on an Android app using dataBinding and am currently trying to add the safe-args plugin, but after enabling the plugin, I can no longer get the root view via binding.root - Android Studio gives the error: Unresolved Reference None of the following candidates is applicable because of a receiver type mismatch: * internal val File.root: File defined in kotlin.io How can I get databinding and safe-args to play nice together? Note that while the code snippet is in Kotlin I will happily

Pass data/bundle using navigateUp in Android Navigation Component

好久不见. 提交于 2019-12-01 21:58:58
I found the question but does not have solution in code I want to have data when backpress/manual back happens. I am using navigateUp() to go back. How can I pass data to previous fragment? navigateUp() does not have any facility to pass data to previous fragment. Even I did not find solution using Safe Args . It's passing data forward. I want to have in backward Frad B -> Frag A. My code to go back to previous fragment Navigation.findNavController(view).navigateUp() My question is, How can i get data in previous fragment. I can navigate to Frag A from Frag B using Natig Babayev According to