I have the following architecture: Fragment A shows a value from an API Call, Fragment B lets the user change the value using an API Call and user can tap a button to travel from A -> B. However when the user changes the value in B and presses back, the call in A's onViewCreated() doesn't trigger so the value shown isn't updated. Looks like onResume() and onStart() also doesn't trigger when a user returns to the fragment in the Backstack.
My question is how can I handle this scenario to trigger an API call in fragment A when returning from fragment B via onBackPressed()
The code to transition from Fragment A -> B(I'm using the navigation component of Jetpack) :
findNavController().navigate(AFragmentDirections.actionAFragmentToBFragment())