BlogTest
BlogTest copied to clipboard
navigation保活Fragment中,用谷歌安全传参,arguments始终为null
val bundle = LoginFragmentArgs.Builder().apply { this.url = "https://sso.bsj.com/register/agreement" this.title = app.getString(R.string.protocol_check1_txt) }.build().toBundle() Navigation.findNavController(it) .navigate(R.id.action_LoginFragment_To_Huiyi31AgreementFragment, bundle),在接收界面,这个arguments始终为null,
我也测试过你demo中 TextView tvNickName = rootView.findViewById(R.id.tv_nick_name); if (getArguments() != null) { String nickName = SettingsFragmentArgs.fromBundle(getArguments()).getNickName(); tvNickName.setText(nickName); } 这个arguments也是为null,