且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从片段通过捆绑到碎片

更新时间:2023-12-03 17:40:40

在您的碎裂片段设置捆绑作为参数。

In your FragmentA fragment set the bundle as the argument.

Bundle args = new Bundle();
args.putInt("doctor_id",value);    
ListFrag newFragment = new ListFrag ();
newFragment.setArguments(args);

在您ListFrag片段让包作为

In your ListFrag fragment get the bundle as

Bundle b = getArguments();
String s = b.getInt("doctor_id");