So if I want to send ArrayList, I have to choose array option in the add argument window along with everything else you mentioned in the video, is it ?
Is it possible to pass data from AppCompactActivity to Fragment, if so, how? E.g. if I have AddEmployeeActivity (of type AppCompatActivity) and EmployeeFragment (of type Fragment), so when I fill in the employee details, I want to click the button and transition to the EmployeeFragment where a new employee will be created using the filled information?
I have a question why not use ViewModel it seems to be stright forward and it suggested by best practices? "This approach offers the following benefits: The activity does not need to do anything, or know anything about this communication. Fragments don't need to know about each other besides the SharedViewModel contract. If one of the fragments disappears, the other one keeps working as usual. Each fragment has its own lifecycle, and is not affected by the lifecycle of the other one. If one fragment replaces the other one, the UI continues to work without any problems." reference - developer.android.com/topic/libraries/architecture/viewmodel#sharing could you please give some feedback regarding your experiences with it? Thank you.
Hey Stevdza-San, the navigation component seems pretty powerful abut the one reason i dont use it in my app is because it doesnt seem to have the feature to save the fragment state, so I use fragment manager to hide/show fragments when the concerned buttons are clicked ( like in a bottom navigation bar ), could you please make a video or even let me know if saving fragment state is possible with the navigation library....
The answer is Shared ViewModel. Check this out: stackoverflow.com/questions/59629541/how-to-save-fragment-state-while-navigating-with-navigation-component
saved my hours of code, i cound parcelise my data earlier thanks to this video, saved my code
saved my day. also worked with passing List data . perfect.
Thank you for existing. Keep up the good work my friend. I learned a lot from this series!!
Thank you again
godness, the direction will appear after rebuilding :"< luckily that u talked about it, ty so much
Thanks sir ❤
I do learn a lot from you!.
thank you so much sir
I wish I could give you more than one like!! You just earned a new subscriber
Thanks a lot bro!
You're welcome!
As always, perfect !!
U R awesome ❤️
Keep up man
do i have to add this plugin or is the safeArgs sufficient ?plugins {
id("kotlin-parcelize")
}
Who has error "Unsolved reference" with @Parcelize annotation - you just need to apply plugin 'kotlin-parcelize' in project graddle
Same over here, I just didn't use the notation @Parcelize, implement the members required by android studio and works fine for me.
@parcelized in deprecated is there a new way instead if implanting the interface?
Helpful
So if I want to send ArrayList, I have to choose array option in the add argument window along with everything else you mentioned in the video, is it ?
How did you add the back button in the toolbar on the second fragment only?
Good job sir 😍
What is the difference between Pacelizable and Serilizable
Is it possible to pass data from AppCompactActivity to Fragment, if so, how? E.g. if I have AddEmployeeActivity (of type AppCompatActivity) and EmployeeFragment (of type Fragment), so when I fill in the employee details, I want to click
the button and transition to the EmployeeFragment where a new employee will be created
using the filled information?
I have a question why not use ViewModel it seems to be stright forward and it suggested by best practices?
"This approach offers the following benefits:
The activity does not need to do anything, or know anything about this communication.
Fragments don't need to know about each other besides the SharedViewModel contract. If one of the fragments disappears, the other one keeps working as usual.
Each fragment has its own lifecycle, and is not affected by the lifecycle of the other one. If one fragment replaces the other one, the UI continues to work without any problems."
reference - developer.android.com/topic/libraries/architecture/viewmodel#sharing
could you please give some feedback regarding your experiences with it?
Thank you.
works great just needed to add id 'kotlin-parcelize' in app build.gradle file as one kotlin android extensions is deprecated
so how do we send protobuf java files as parameters with nav arg
Would you be able to use this method to save data from Fragment A and pass it on to say Fragment C?
1 like is added to this video!😃
Really good series thank you.
Can you do something with MVVM and Coroutines?
Nice 👌❤️
Sir kotlin-android-extension is now deprecated is it still the right way?
I made video about migrating from that plugin.
Hey Stevdza-San, the navigation component seems pretty powerful abut the one reason i dont use it in my app is because it doesnt seem to have the feature to save the fragment state, so I use fragment manager to hide/show fragments when the concerned buttons are clicked ( like in a bottom navigation bar ), could you please make a video or even let me know if saving fragment state is possible with the navigation library....
The answer is Shared ViewModel. Check this out: stackoverflow.com/questions/59629541/how-to-save-fragment-state-while-navigating-with-navigation-component
How can we get data from Fragment B to Fragment A by this method...?
same method as shown in video
Just add an argument on Fragment A.
@@StevdzaSan Thanks man... Waiting for more videos on retrofit series