BlogTest icon indicating copy to clipboard operation
BlogTest copied to clipboard

navigation保活Fragment中,用谷歌安全传参,arguments始终为null

Open M78Code opened this issue 3 years ago • 0 comments

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,

M78Code avatar Feb 13 '22 08:02 M78Code