4

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.

Swapnil Musale
  • 182
  • 1
  • 15
  • you need to know about lifecycle of jetpack views . you can check this link https://stackoverflow.com/questions/66546962/jetpack-compose-how-do-i-refresh-a-screen-when-app-returns-to-foreground – Syed Ibrahim Nov 04 '22 at 03:58

0 Answers0