*Navigation组件
res下创建navigation文件夹 文件下navigation文件
1.在activity的xml中添加控价
<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="@id/device_area"
app:defaultNavHost="true"
app:navGraph="@navigation/nav" />
activity中进行跳转
Navigation.findNavController(this, R.id.nav_host_fragment).navigate(R.id.faceFragment, bundle);
fragment中进行跳转
NavHostFragment.findNavController(HomeFragment.this).navigate(id);
通过声明的action进行跳转
<fragment
android:id="@+id/YellowFragment"
android:name="com.example.eyemhealth.fragment.YellowFragment"
tools:layout="@layout/fragment_yellow"
android:label=&#