diff options
author | Bryson Steck <steck.bryson@gmail.com> | 2021-05-09 00:44:42 -0600 |
---|---|---|
committer | Bryson Steck <steck.bryson@gmail.com> | 2021-05-09 00:44:42 -0600 |
commit | 2734f6777a6b7c439d9bc55c8756155721f76fa5 (patch) | |
tree | ca830b6dab31abef50e49b1c96698d5b127b5c5c /app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel | |
parent | 5c0ed1708a3f23fcb78cfe8442487a403674c56a (diff) | |
download | wiimmfi-watcher-2734f6777a6b7c439d9bc55c8756155721f76fa5.tar wiimmfi-watcher-2734f6777a6b7c439d9bc55c8756155721f76fa5.tar.gz wiimmfi-watcher-2734f6777a6b7c439d9bc55c8756155721f76fa5.tar.bz2 |
added clear button but doesn't work yet
Diffstat (limited to 'app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel')
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel/FriendCodeViewModel.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel/FriendCodeViewModel.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel/FriendCodeViewModel.java index ae300c0..87db049 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel/FriendCodeViewModel.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel/FriendCodeViewModel.java @@ -1,6 +1,7 @@ package me.brysonsteck.wiimmfiwatcher.viewmodel; import android.app.Application; +import android.database.sqlite.SQLiteDatabase; import androidx.databinding.ObservableArrayList; import androidx.lifecycle.AndroidViewModel; @@ -45,6 +46,13 @@ public class FriendCodeViewModel extends AndroidViewModel { return entries; } + public boolean deleteAll() { + for (FriendCode entry: entries) { + db.getFriendCodeDao().nukeTable(); + } + return true; + } + public void saveFriendCode(String name, String friendCode) { saving.setValue(true); new Thread(() -> { |