I come across requirement where I have to do certain task when user is coming via back navigation flow.
Suppose : Currently user is on A Screen and on button click it got navigated to B Screen.
On B Screen I'm using BackHandler
to navigate user to back screen using navController.navigateUp()
as this code working perfectly to navigate user to back screen.
But I'm unable to identify is user coming via back navigation or initial launch flow.
Already Tried Solution : val isFromBackNavigation = parentNavController.currentBackStackEntryAsState().value?.destination?.route == AppNav.Wishlist.route
This returns true for initial launch also.