diff --git a/app/src/main/java/com/example/nemophila/MapsFragment.java b/app/src/main/java/com/example/nemophila/MapsFragment.java index a078e85..70c0e99 100644 --- a/app/src/main/java/com/example/nemophila/MapsFragment.java +++ b/app/src/main/java/com/example/nemophila/MapsFragment.java @@ -89,7 +89,9 @@ friendViewModel = new ViewModelProvider(getActivity()).get(FriendViewModel.class); postsViewModel = new ViewModelProvider(getActivity()).get(PostsViewModel.class); + //フレンドの更新が入った時の処理(LiveDataへの購読) + friendViewModel.getFriends(nemophila.getUid()); friendViewModel.getFriendsLiveData().observe(getActivity(), friends -> { Toast.makeText(getActivity(), String.format("フレンドの更新を確認しました。"), @@ -99,6 +101,8 @@ nemophila.setFriends(friends); }); + + // 店情報の更新が入った時の処理(LiveDataへの購読) shopsViewModel.getShopsLiveData().observe(getActivity(), shops -> { Toast.makeText(getActivity(),