How to Share Data between Fragment and Activity || Share Data using ViewModel || FoxAndroid || 2021
HTML-код
- Опубликовано: 12 июн 2021
- How to Share Data between Fragment and Activity || Share Data using ViewModel || FoxAndroid || 2021
Source Code: DM on Instagram
Follow me on Instagram: / foxandroidblog
Follow me on Facebook: / foxandroidblog
---------------------------------------------------------------------------------------------------------------------------------------------------------
Equipment I Use to Make My videos:
📱 Phone -: amzn.to/3px6ucS
🎧Earphones -: amzn.to/3JecI98
🎙️Mic - : amzn.to/310u7Rp
🎙️Mic - : amzn.to/3He96SW
🔊Speakers - : amzn.to/3Hgfzg8
💾External HardDrive - amzn.to/3JoRzZV
💻 My PC build: www.amazon.in/shop/foxandroid
--------------------------------------------------------------------------------------------------------------------------------------------------------
Hey Developers,
In this video, I have explained :
* How to share the data between Activity and a Fragment using shared ViewModel
AlarmManager in Android Studio
• AlarmManager in Androi...
How to Sort Recyclerview items using Java
• How to Sort Recyclervi...
Sort Recyclerview using Kotlin
• Sort Recyclerview usin...
AlarmManager using Kotlin in Android Studio
• AlarmManager using Kot...
Send Data from one Fragment to Another Fragment
• Send Data from one Fra...
Fragments Implementation using Kotlin
• Fragments Implementati...
#sharedata #fragments #androidstudio Наука
finally found the answer to my questions. The video is just super. Thanks a lot))))
Great Series, Thanks for sharing !! Have a question, we can do something what is mentioned in the playlist using Navigation Compoenent right ? Do u see any advantage of still using fragment manager !!
Halped A lot Man keep it up !!
Great vid! Please do vid using Kotlin..thanks!
But I need without button just like this if i in current visible fragment then update activity var with my fragment var
Like fragment
EditeText ed = view. findViewById(R.id.ed);
((mainActivty)getActivity()).ed = ed;
How can do like this i try but it's just pass last fragment address not current fragment
If I use button then work but I need without button
Nice explanation, but what if I have multiple data to pass at same time? for example I have fragments that have Strings and Booleans and i want to get them to print them in pdf document.
How do you get know which data is when there is more than one?
set and get all fields you want inside the viewmodel and set and get them in any place in your program.
Nice video. Can you please suggest how to transfer data from Activity to Fragment too, where data will be send by the activity and fragments listen.
Same method can be used...video will be out soon
@@_foxandroidi am trying to implement tablayout in an activity by creating three fragments .. is it possible to share the same data(like a firebase uid) from an activity to all three fragments?
@@_foxandroid it's been 8 months now. Where is the video to transfer data from Activity to Fragment??
Why not kotlin
how to send data from activity into fragment?
I have same question. Please help
how to code not clear