Questions tagged [android-safe-args]

144 questions
0
votes
1 answer

where to write the Navigation Component safeArgs dependencies in gradle

I started to learn navigation component library but I cannot figure out where to add the safeargs dependencies. I should add these dependencies in https://developer.android.com/jetpack/androidx/releases/navigation. I tried many scenarios but none of…
yusufff
  • 3
  • 4
0
votes
0 answers

Directions parts are not generated in Java (Generated) although build.gradle sync successfully

Directions parts are not generated in Java (Generated) even though I have specified fragment actions in Android Studio and many time rebuild project[enter image description here][1]. So I can't use directions. What would be the…
TARIF
  • 1
  • 1
0
votes
1 answer

How to pass an image from one fragment to another using Safe Args?

I want to pass some data from one fragment to another and I have managed to successfully pass every single data except an imageView, I don't know how to do that. Here's my code below passing data: 1st fragment: val action: NavDirections = …
0
votes
1 answer

Passing Data Between Fragments Using Safe Args

I'm trying to implement data transfer between fragments using Safe Args, but I'm stuck at the moment of setting Gradle. Project Gradle looks like this // Top-level build file where you can add configuration options common to all…
0
votes
1 answer

How to change the text of text view on fragment B, when I click on different views in fragment A accordingly in kotlin?

I have Two Fragments, for example - FragmentA and FragmentB In FragmentA I have multiple ImageButtons, In FragmentB I have a TextView What I want to do is, when I click on any ImageButton in FragmentA then I want to assign a particular text to…
0
votes
1 answer

When updating/deleting entry in RoomDatabase and then creating new entry App crashes

I work on an app where I have a recyclerview and a fab on the first fragment (listFragment) you see when you open the app. you click the fab, camera opens, you make a picture -> click ok and get to another fragment, there you fill out some stuff and…
0
votes
3 answers

how do i correctly implement safeargs?

I am trying to follow a tutorial in order to implement and use a room database YouTube-link. My problem is that my gradle files look so different compared to what is shown in the video that I have no idea where to put the id…
nikenzo
  • 13
  • 3
0
votes
1 answer

NavArgs returning a RuntimeException

NavArgs not returning a value, I just get this when I try to update through the setOnClickListener in update fragment: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException Caused by: java.lang.IllegalArgumentException: Required…
Joe Pleavin
  • 436
  • 1
  • 4
  • 21
0
votes
1 answer

com.app.android.models.Item is not Serializable or Parcelable

Trying learn kotlin so any help would really appreciate. I am trying to pass this object between fragments and getting the message it's not serializable or parcelable. Any suggestions on why this would happen? @Serializable data class…
Monica
  • 121
  • 1
  • 7
0
votes
2 answers

Please what dependency is missing or confliting for safe args

I am learning some kotlin concepts. I don't really understand yet. I added SafeArgs classpath and plugin to the appropriate build.gradle file. Here's the classpath: classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.1" And Here's…
Edwin
  • 565
  • 11
  • 26
0
votes
1 answer

Android Studio: Passing argument from fragment to fragment and using it

I am following the official tutorial on Android development, and am having trouble passing arguments with SafeArgs. Here is the code in the first fragment that passes the argument to the second…
0
votes
1 answer

How can I launch a fragment with safe args in an instrumentation test?

Below I have a test class designed to launch a fragment in isolation and test the navController's ability to navigate. The first test, landingToGameFragmentTest() works perfectly! The second test launches a fragment that depends on safe args to be…
0
votes
1 answer

How can I assign value to variable declared by Fragment, value from onBindViewHolder?

I would like to assign value to variable that is declared by Fragment, from the value of position: Int variable set from onBindViewHolder. My strategy is that get the value of position: Int to pass the value assigning for which the item clicked from…
0
votes
1 answer

Use of safe arguments in android navigation

Is safeArgs plugin used for passing data or we can simply use it for navigation (even when we donot want to pass any data to the destination)? ... I have used navigation Component and safeArgs plugin but my question is should we use the safeArgs…
0
votes
1 answer

How pass different args to fragment [navigation] Android

I have 4 fragment , A,B,C,D FROM A,B,C I can navigate to D fragment, I want to pass different args from each fragment…