创建一个Fragment路由
@Route("/fragment/test")
public class TestFragment extends Fragment {
@Extra("userId")
int userId;
@Extra("userName")
String userName;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//参数注入
Rudolph.bind(this);
}
}
- 1.引用方式调用
Fragment fragment = TestFragmentRouter.builder().userId(11).userName("John").execute();
- 2.URL方式调用
Rudolph.builder("/fragment/user?userId=11&userName=John").execute();