Questions tagged [android-safe-args]
144 questions
1
vote
2 answers
DataBindingUtil is not working after adding safe-args dependency
I'm adding the safe-args dependency:
project level:
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$version_kotlin"
classpath…

sir-haver
- 3,096
- 7
- 41
- 85
0
votes
1 answer
Unable to enable "safe args" as instructed in Google's official "Build Your First Android App" Tutorial due to missing sections
I have been following this tutorial:
https://developer.android.com/codelabs/build-your-first-android-app-kotlin
but I am stuck at this section which seems to not refer to reality at…

define_makefile
- 3
- 1
0
votes
0 answers
Should I use ViewModel, safe args or both? If both, how to do this a proper way?
There're 3 fragments
AuthFragment - is responsible for the authentication of the user. The authenticated user is stored in the AuthUser class. The 'AuthUserclass is passed to theHomeFragment` via safe args.
HomeFragment - is responsible for…

Edziju
- 399
- 11
0
votes
1 answer
Some Navigation Graph Actions Are Not Resolved
I have multiple nav graphs in my projects each has multiple actions defined.
Lately, I am getting this error while Building the app preventing me from generating APK
Unresolved reference: action...
This error appears in some actions only (4…

Abuzaid
- 853
- 8
- 28
0
votes
0 answers
Why am I getting an error of cannot find implementation of RoomDatabase?
So, I am storing two textviews on the click of an imageview from the Fragment QuestionFragment.kt and sending it over another fragment (ToLearnFragment.kt) using safeargs. So when I click on the button that will take to me this Fragment, I get an…

PurpleRabbit
- 61
- 5
0
votes
1 answer
Using safeargs to create deep links
I am creating an explicit deeplink to a fragment in my app (Navigation component). This is how I am currently doing it:
val args = bundleOf(
"roomId" to roomId,
"receiver" to receiver
)
return NavDeepLinkBuilder(context)
…

ShahiM
- 3,179
- 1
- 33
- 58
0
votes
0 answers
Plugin [id: 'androidx.navigation.safeargs'] was not found in any of the following sources
When syncing ("Synk now") in my android JAVA project this error appers.
I have the plugins and class paths that the documentation specifies.
Have I missed something maybe?
Doc ref:…

HalSoul
- 31
- 3
0
votes
0 answers
Navigation Action argument not updating after first call to that navigation action
I am using Android navigation with safe args and directions for my Android app. I am passing an Int argument in a navigation action. However, after the first call to that action the passed argument, is not getting updated.
This is how I set the…

Iñigo Bereciartua
- 72
- 1
- 10
0
votes
0 answers
Method Classpath() not found. Enabling SafeArgs in app
Currently going through Android Developers "Build Your First Android App in Kotlin" tutorial. Attempting to enable safe args. Running into the following error:
enter image description here
How should I fix this?
So far I have added the id…

soham mehra
- 1
- 1
0
votes
0 answers
How can i get my args.field from my activity to my viewmodel
I want to use my args.breweryName from my reviewActivity in my reviewViewModel but i don't know what's the best way to do it. I have tried using savestatehandle but i'm not experienced with that. I'm new to programming with kotlin so i would…
0
votes
0 answers
Unable to access to a fragment that have nullable argument using navigation components
My OrdersFragment has one nullable argument called Option:
To work with nullable args I have declared a variable of this way above of…

FreddicMatters
- 175
- 12
0
votes
1 answer
Create a deeplink for destination wiht safe args
I created a deeplink for a destination but came to the wrong page.
Sure about defining navigation in the manifest and the other config.
For example:

Sajad Hosseini
- 135
- 8
0
votes
1 answer
Android SafeArgs Navigation Unreslved Reference camelcase kotlin vs underscore xml
I have a fragment that uses:
val action = LoginFragmentDirections.actionLoginToHome()
findNavController().safeNavigate(action)
and the Navigation graph XML is declared as:

htafoya
- 18,261
- 11
- 80
- 104
0
votes
0 answers
Android passing ArrayList to Fragment from Fragment not working
I am trying to pass an ArrayList between two fragments. I am using the navigation component and tried many methods nothing works please guide me.
I used the safe args but still it is not working can you please guide me. I am new to android.
user20008723
0
votes
1 answer
When values are sent to a second fragment screen, they are incorrectly displayed
When I attempt to display two input views from one fragment to another, I get a problem. The navigation is fully functional. But the values appear as resources.
binding.buttonLogin.setOnClickListener{
val userName = binding.etUserName.toString()
val…

WALFAZ
- 17
- 5