android Java Multiple classes update activity UI (how to share data)

前端 未结 1 1626
离开以前
离开以前 2021-01-23 10:09

I know this question has been asked several times, but I cannot seems to find a suitable answer or there is multiple solutions. I am just trying to find were to look and the bes

相关标签:
1条回答
  • 2021-01-23 10:45

    I'd suggest having look at EventBus as per their description:

    Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.

    OR

    Have a look at the official android documentation Communicating with fragments which shows how to use ViewModels to share data between activities and fragments and fragment to fragment.

    0 讨论(0)
提交回复
热议问题