diff options
Diffstat (limited to 'app/src/main/java/com/example/wiimmterfaceandroid/viewmodel')
-rw-r--r-- | app/src/main/java/com/example/wiimmterfaceandroid/viewmodel/FriendCodeViewModel.java | 3 |
1 files changed, 3 insertions, 0 deletions
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<FriendCode> entries = new ObservableArrayList<>(); MutableLiveData<Boolean> 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); |