aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel')
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/viewmodel/FriendCodeViewModel.java8
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(() -> {