listAdapter = new NewTransactionItemsAdapter(viewModel, mProfile);
list.setAdapter(listAdapter);
list.setLayoutManager(new LinearLayoutManager(activity));
- Data.profile.observe(this, profile -> {
+ Data.profile.observe(getViewLifecycleOwner(), profile -> {
mProfile = profile;
listAdapter.setProfile(profile);
});
}).attachToRecyclerView(list);
viewModel.isSubmittable()
- .observe(this, isSubmittable -> {
+ .observe(getViewLifecycleOwner(), isSubmittable -> {
if (isSubmittable) {
if (fab != null) {
fab.show();