use of com.shu.studentmanager.viewmodel.AdminViewModel in project student-manager by SYYANI.
the class AdminFragment method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
adminViewModel = new ViewModelProvider(this).get(AdminViewModel.class);
adminFragmentBinding = DataBindingUtil.inflate(inflater, R.layout.admin_fragment, container, false);
adminFragmentBinding.setAdminViewModel(adminViewModel);
adminFragmentBinding.setLifecycleOwner(getActivity());
StudentManagerApplication application = (StudentManagerApplication) getActivity().getApplication();
adminFragmentBinding.adminFramentTeacherId.setText(application.getId());
adminFragmentBinding.adminFragmentTeacherName.setText(application.getName());
View root = adminFragmentBinding.getRoot();
return root;
// return inflater.inflate(R.layout.student_fragment, container, false);
}
Aggregations