On the docs it is listed as a public method that I should be able to use. However, it does not appear as a choice when I use the dot operator on my NavController field neither as a method or property. Can't get it to work on the debugger expression evaluator either. I can confirm my object is of type androidx.navigation.NavController
As per the Navigation 2.3.0-alpha02
release notes:
Convenience methods of
getCurrentBackStackEntry()
andgetPreviousBackStackEntry()
have been added to make it easier to retrieve aNavBackStackEntry
for the current and previous destinations. (b/79672220)
So make sure you upgrade to Navigation 2.3.0-alpha02
.