且构网

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

Safeargs库不会生成方向类

更新时间:2023-09-18 09:25:40

查找作为导航源的片段的类.如果您定义了从FragmentA到FragmentB的导航,您会发现FragmentADirections类及其中定义的动作(在nav_graph.xml中).

Look for the class of the fragment which is the source of navigation. If you define navigation from FragmentA to FragmentB, you will find FragmentADirections class with the actions you defined (in nav_graph.xml) in it.

然后,要生成方向类(也为参数类),您需要转到Project level gradle,然后单击build命令.在这里,我附上了一个屏幕截图,以使您有一个清晰的了解.

Then, to generate direction class ( Also argument class) you need to go Project level gradle then click the build command. Here I attached a screenshot to give a clear understanding.