Skip to content

why fragment need construction method?? #14

@l007001

Description

@l007001

public class ProfileFragment extends BaseFragment<ProfileContract.Presenter> implements ProfileContract.View {

@Inject
public ProfileFragment() {
    // Required empty public constructor for Injection
}

private FragmentProfileBinding dataBinding;

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View view = inflater.inflate(R.layout.fragment_profile, container, false);
    dataBinding = DataBindingUtil.bind(view);
    return view;
}

@Override
public void showModel(ProfileModel model) {
    dataBinding.setModel(model);
}

}

The official document does not say that this construction method needs to be added.
Can you explain it for me? thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions