architecture-components-samples icon indicating copy to clipboard operation
architecture-components-samples copied to clipboard

NavigationUI.onNavDestinationSelected(MenuItem)

Open squm opened this issue 4 years ago • 0 comments

Hello, I noticed using NavigationUI.onNavDestinationSelected turns the Back button into Home button, keeps the Back button icon

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
    return NavigationUI.onNavDestinationSelected(item, navController)
            || super.onOptionsItemSelected(item);
}

squm avatar May 27 '20 07:05 squm