From b202760cdc2b443fd07dcee593ed7f3e09d6b77b Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Tue, 4 May 2021 23:31:34 -0600 Subject: watched friend codes work --- .../com/example/wiimmterfaceandroid/viewmodel/FriendCodeViewModel.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/src/main/java/com/example/wiimmterfaceandroid/viewmodel') diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/viewmodel/FriendCodeViewModel.java b/app/src/main/java/com/example/wiimmterfaceandroid/viewmodel/FriendCodeViewModel.java index ac039ff..c7bbe7d 100644 --- a/app/src/main/java/com/example/wiimmterfaceandroid/viewmodel/FriendCodeViewModel.java +++ b/app/src/main/java/com/example/wiimmterfaceandroid/viewmodel/FriendCodeViewModel.java @@ -17,6 +17,8 @@ import androidx.room.RoomDatabase; import androidx.databinding.ObservableArrayList; +import java.util.LinkedHashSet; + public class FriendCodeViewModel extends AndroidViewModel { ObservableArrayList entries = new ObservableArrayList<>(); MutableLiveData saving = new MutableLiveData<>(); @@ -62,6 +64,7 @@ public class FriendCodeViewModel extends AndroidViewModel { newEntry.name = name; newEntry.friendCode = friendCode; db.getFriendCodeDao().insert(newEntry); + entries.add(newEntry); } saving.postValue(false); -- cgit v1.2.3