How to Share Data between Fragment and Activity || Share Data using ViewModel || FoxAndroid || 2021

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ธ.ค. 2024

ความคิดเห็น • 16

  • @ЖаксылыкЖуасбай
    @ЖаксылыкЖуасбай 3 ปีที่แล้ว +2

    finally found the answer to my questions. The video is just super. Thanks a lot))))

  • @bjugdbjk
    @bjugdbjk 2 ปีที่แล้ว

    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 !!

  • @iftak01
    @iftak01 3 ปีที่แล้ว +2

    Great vid! Please do vid using Kotlin..thanks!

  • @mohamedzakariagridi1059
    @mohamedzakariagridi1059 3 ปีที่แล้ว +1

    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?

    • @lyawileh.a8741
      @lyawileh.a8741 3 ปีที่แล้ว

      set and get all fields you want inside the viewmodel and set and get them in any place in your program.

  • @codeexplorer4212
    @codeexplorer4212 3 ปีที่แล้ว +2

    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.

    • @_foxandroid
      @_foxandroid  3 ปีที่แล้ว +2

      Same method can be used...video will be out soon

    • @dineshramalingam959
      @dineshramalingam959 3 ปีที่แล้ว +1

      @@_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?

    • @yugalkishore3154
      @yugalkishore3154 2 ปีที่แล้ว

      @@_foxandroid it's been 8 months now. Where is the video to transfer data from Activity to Fragment??

  • @sem_dev
    @sem_dev 3 ปีที่แล้ว +1

    Halped A lot Man keep it up !!

  • @FarooqAhmad-lr1fx
    @FarooqAhmad-lr1fx 2 ปีที่แล้ว +1

    how to send data from activity into fragment?

    • @amolthombre8259
      @amolthombre8259 2 ปีที่แล้ว

      I have same question. Please help

  • @ekchhuon4976
    @ekchhuon4976 3 ปีที่แล้ว +2

    Why not kotlin

  • @Noob-i4w
    @Noob-i4w 9 หลายเดือนก่อน

    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

  • @tunguyen-nm8qn
    @tunguyen-nm8qn ปีที่แล้ว

    how to code not clear