Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
FIX Lint FragmentLiveDataObserve
Browse files Browse the repository at this point in the history
  • Loading branch information
davorpa committed Mar 5, 2020
1 parent 1191ea2 commit f938998
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Expand Up @@ -24,7 +24,7 @@ public View onCreateView(@NonNull LayoutInflater inflater,
ViewModelProviders.of(this).get(GalleryViewModel.class);
View root = inflater.inflate(R.layout.fragment_gallery, container, false);
final TextView textView = root.findViewById(R.id.text_gallery);
galleryViewModel.getText().observe(this, new Observer<String>() {
galleryViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
Expand Down
Expand Up @@ -24,7 +24,7 @@ public View onCreateView(@NonNull LayoutInflater inflater,
ViewModelProviders.of(this).get(HomeViewModel.class);
View root = inflater.inflate(R.layout.fragment_home, container, false);
final TextView textView = root.findViewById(R.id.text_home);
homeViewModel.getText().observe(this, new Observer<String>() {
homeViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
Expand Down
Expand Up @@ -24,7 +24,7 @@ public View onCreateView(@NonNull LayoutInflater inflater,
ViewModelProviders.of(this).get(SendViewModel.class);
View root = inflater.inflate(R.layout.fragment_send, container, false);
final TextView textView = root.findViewById(R.id.text_send);
sendViewModel.getText().observe(this, new Observer<String>() {
sendViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
Expand Down
Expand Up @@ -24,7 +24,7 @@ public View onCreateView(@NonNull LayoutInflater inflater,
ViewModelProviders.of(this).get(ShareViewModel.class);
View root = inflater.inflate(R.layout.fragment_share, container, false);
final TextView textView = root.findViewById(R.id.text_share);
shareViewModel.getText().observe(this, new Observer<String>() {
shareViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
Expand Down
Expand Up @@ -24,7 +24,7 @@ public View onCreateView(@NonNull LayoutInflater inflater,
ViewModelProviders.of(this).get(SlideshowViewModel.class);
View root = inflater.inflate(R.layout.fragment_slideshow, container, false);
final TextView textView = root.findViewById(R.id.text_slideshow);
slideshowViewModel.getText().observe(this, new Observer<String>() {
slideshowViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
Expand Down
Expand Up @@ -24,7 +24,7 @@ public View onCreateView(@NonNull LayoutInflater inflater,
ViewModelProviders.of(this).get(ToolsViewModel.class);
View root = inflater.inflate(R.layout.fragment_tools, container, false);
final TextView textView = root.findViewById(R.id.text_tools);
toolsViewModel.getText().observe(this, new Observer<String>() {
toolsViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
Expand Down

0 comments on commit f938998

Please sign in to comment.