Android中使Navigation传递集合

 将集合通过Bundle传递
val bundle = Bundle()
Navigation.findNavController(binding.root).navigate(R.id.actionShowDeviceAddFromAutoDetection,bundle)

  动作Id:

actionShowDeviceAddFromAutoDetection
<action
            android:id="@+id/actionShowDeviceAddFromAutoDetection"
            app:destination="@id/deviceAddFragment"
            app:popUpTo="@id/mainFragment"
            app:popUpToInclusive="false"
            app:enterAnim="@anim/nav_default_enter_anim"
            app:exitAnim="@anim/nav_default_exit_anim"
            app:popEnterAnim="@anim/nav_default_pop_enter_anim"
            app:popExitAnim="@anim/nav_default_pop_exit_anim" />

  

posted on 2022-02-20 20:19  巫山老妖  阅读(128)  评论(0编辑  收藏  举报