'how to implement UI changes when resuming fragment in kotlin
i'm a beginner developing in kotlin * android studio. i have 2 fragments in my app: a main fragment and a settings fragment. the two share a viewmodel. heres what i'm trying to accomplish:
- app launches, takes you to main fragment
- user clicks settings button, takes you to settings fragment
- user alters settings (preferences stored in shared viewmodel)
- user returns to main fragment, UI of main fragment is altered based on which settings were selected
i have completed steps 1-3 and am trying to implement 4. i am thinking i should override onResume() in my main fragment and implement UI changes there. first off, is this a good idea? if so, how can i access my UI elements from onResume()? any guidance is appreciated
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
