STAR-ZERO / navigation-keep-fragment-sample

392 stars 63 forks source link

No work addOnDestinationChangedListener #22

Open webserveis opened 4 years ago

webserveis commented 4 years ago

Test

navController.addOnDestinationChangedListener { _, destination, _ ->
    Log.d(TAG, "addOnDestinationChangedListener" + destination.id)
    //toolbar.title = navController.currentDestination?.label
}

onlly call once time

I try this, but no 100% work change return null for super.navigate(destination, args, navOptions, navigatorExtras) No keepState U_U

tudny commented 4 years ago

Test

navController.addOnDestinationChangedListener { _, destination, _ ->
    Log.d(TAG, "addOnDestinationChangedListener" + destination.id)
    //toolbar.title = navController.currentDestination?.label
}

onlly call once time

I try this, but no 100% work change return null for super.navigate(destination, args, navOptions, navigatorExtras) No keepState U_U

Sorry, but the "suggested change" just flashes the fragment every time you click the bottomNavBar more then one time :(

webserveis commented 4 years ago

No poblem, I solved change title in each fragment, works fine