Navigation

简介

xxx

资料

Android Navigation库使用详解

NavController

说明

导航(跳转)控制

获取

private NavController navController;

NavHostFragment navHostFragment = (NavHostFragment) getSupportFragmentManager().findFragmentById(R.id.myAccountActivityFragment);
if (navHostFragment != null) {
    navController = navHostFragment.getNavController();
}

NavController navController = Navigation.findNavController(this, R.id.myAccountActivityFragment);

if (getView() != null) {
    NavController navController = Navigation.findNavController(getView());
}

你可能感兴趣的:(android)