You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I modified little code like this. The only thing I change is when user press back button, instead of closing application, I'm finding and providing start destination. The thing is redirection works fine, screen is also changing, but tabs are not changing!
Code:
private fun navigateToDestination(navController: NavController, itemCbn: Model) {
if (itemCbn.destinationId == -1) {
throw RuntimeException("please set a valid id, unable the navigation!")
}
val builder = NavOptions.Builder()
.setLaunchSingleTop(true)
.setEnterAnim(R.anim.fade_in)
.setExitAnim(R.anim.fade_out)
.setPopEnterAnim(R.anim.anim_slide_up)
.setPopExitAnim(R.anim.anim_slide_down)
// pop to the navigation graph's start destination
builder.setPopUpTo(findStartDestination(navController.graph).id, false)
val options = builder.build()
try {
//navController.popBackStack()
navController.navigate(itemCbn.destinationId, null, options)
} catch (e: IllegalArgumentException) {
Log.w("TAG", "unable to navigate!", e)
}
}
Kindly help ASAP.
Troubleshooting: I tried to call show() from destination listener but it is not helping expected way. If you're not getting time to write the code, just guide me for the solution and I'll do it for you.
The text was updated successfully, but these errors were encountered:
I modified little code like this. The only thing I change is when user press back button, instead of closing application, I'm finding and providing start destination. The thing is redirection works fine, screen is also changing, but tabs are not changing!
Code:
Kindly help ASAP.
Troubleshooting: I tried to call show() from destination listener but it is not helping expected way. If you're not getting time to write the code, just guide me for the solution and I'll do it for you.
The text was updated successfully, but these errors were encountered: