From d2e633b3874822679e11cb893d573fc243644c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 11 Jul 2024 15:56:46 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=8D=E3=83=BC=E3=83=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/example/childguard/TestService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/example/childguard/TestService.java b/app/src/main/java/com/example/childguard/TestService.java index 0af0418..3b8c702 100644 --- a/app/src/main/java/com/example/childguard/TestService.java +++ b/app/src/main/java/com/example/childguard/TestService.java @@ -24,7 +24,6 @@ import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationManagerCompat; import com.google.firebase.firestore.DocumentReference; -import com.google.firebase.firestore.DocumentSnapshot; import com.google.firebase.firestore.FirebaseFirestore; public class TestService extends Service { @@ -74,7 +73,7 @@ public class TestService extends Service { return flags; // IDが初期化されていない場合は何もしない } else { mDocRef = FirebaseFirestore.getInstance().document("status/" + this.userId);//現在の位置を取得 - initNotification(mDocRef);//現在の位置を引数に initNotification()を処理 + setSnapshotListener(mDocRef);//現在の位置を引数に initNotification()を処理 } if (isNotBluetoothGranted()) return flags; @@ -152,7 +151,7 @@ public class TestService extends Service { registerReceiver(receiver, intentFilter); } - private void initNotification(DocumentReference mDocRef) { + private void setSnapshotListener(DocumentReference mDocRef) { // Initialize the PeriodicTaskManager // (Assuming it's done elsewhere as it's not shown in the original code)