Questions tagged [android-safe-args]

144 questions
9
votes
0 answers

Android Navigation component - can't use Extras and Safe Args

I'm using the Android Navigation component with SafeArgs, and I want to add a shared element transition to an action. According to the documentation, I should be able to simply add an Extras object as a parameter to navigate(), so I try…
8
votes
1 answer

SavedStateHandle returning null values

I have an ActionBar menu icon that opens a CategoryFragment. This fragment takes in a category object SafeArgs argument passed from another fragment. In the CategoryFragment, I store the category's name and id into the fragment's shared ViewModel as…
7
votes
3 answers

How to add SafeArgs to new top level Kotlin gradle

I m gonna use Navigation Framework with fragments but at the dependency step, when i tried to add SafeArgs from documentation i see that the new top level gradle file is different from documentation so i can't add it. Can you explain how to add…
Sevban Bayır
  • 196
  • 3
  • 13
7
votes
1 answer

Use parcelable with safe args in navigation components

I want to use Parcelable with the Navigation Components and Safe Args in version 1.0.0-alpha07. Although since alpha 03 Parcelable should be supported by Safe Args, but I'm not able to use them. The only way to use it is with…
5
votes
3 answers

Too many arguments for public final fun actionFragmentAToDetailActivity()

Actually DetailActivity(need to pass arguments) is present in Library module and I need to launch it from app (FragmentA) but I am getting Build error as follows: Too many arguments for public final fun actionFragmentAToDetailActivity() I am using…
5
votes
2 answers

Updated the Navigation framework and getting error - "getActionId overrides nothing"

I have updated the Navigation framework from 2.3.5 to the 2.4.0-alpha01 version. I use it with Safe Args gradle plugin. After update, I started getting 'getActionId' overrides nothing and 'getArguments' overrides nothing errors. I think this is…
5
votes
1 answer

Issue with Navigation Component Duplicate NavArgs

I have a fragment: class SomeFragment { private val args by navArgs() } this fragment is used in two navigation graph: first_nav.xml ....
5
votes
2 answers

Passing an argument between two fragments each of them in a different Navigation Graph

Using Android Navigation Component. I have two Navigation Graphs (each of them with their own flow), lets say navigation graphs A and B. I navigate successfully from A to B, but I can't manage to pass an argument from the last Fragment included in…
4
votes
1 answer

Could not find android.arch.navigation:navigation-safe-args-gradle-plugin:2.3.5.?

I am using android navigation components but it is giving an error A problem occurred configuring root project 'AndroidCodingChallenge'. Could not resolve all artifacts for configuration ':classpath'. Could not find…
Edgar
  • 860
  • 1
  • 17
  • 38
4
votes
1 answer

Android Safe Args, nav_graph and enums error: Comparison of incompatible enums is always unsuccessful

I'm experiencing a weird issue here with Safe Args when trying to pass an argument of a type that's an enum defined inside such fragment class. Some code, for clarification. This is the enum, as it is defined inside the "EvaluationFragment" kotlin…
Fran Marzoa
  • 4,293
  • 1
  • 37
  • 53
4
votes
1 answer

How to pass "bitmap" as argument using safe args

I want to pass Bitmapas an argument to another fragment using safe args. what is the correct argType for passing a bitmap.
4
votes
0 answers

Passing arguments with BottomNavigationView using Safeargs component

I am trying to use Navigation and SafeArgs components in my Android application along with BottomNavigationView but I'm not able to pass arguments through a bottomnavigationview. This is my case: HomeActivity: hosts all fragments and pass an…
4
votes
2 answers

How to pass data from the navigationdrawer to Activity using safe-args?

Let's say we have a project like this one: class MainActivity : AppCompatActivity() { private lateinit var drawerLayout: DrawerLayout private lateinit var appBarConfiguration : AppBarConfiguration override fun…
3
votes
1 answer

Gradle applying a plugin in Android Studio (safeargs for navigationbar)

I am trying to learn Android studio and following the official tutorial, but have encountered a wall in a section regarding Gradle, due to the fact that the guide seems to be outdated. (Guide is here) Im stuck at the part where we need to enable…
Ymi
  • 609
  • 6
  • 18
3
votes
2 answers

how to pass a value using android navigation if the default value null

I'm using android navigation components with safe args. I set that the argument is null-able and default value as null too. The problem is when I want to pass any value an error is shown: required: no arguments found: Character reason: actual and…
MaYar
  • 41
  • 1
  • 4
1
2
3
9 10