diff --git a/app/src/main/java/com/example/childguard/TestService.java b/app/src/main/java/com/example/childguard/TestService.java index 2d9f11d..69b1546 100644 --- a/app/src/main/java/com/example/childguard/TestService.java +++ b/app/src/main/java/com/example/childguard/TestService.java @@ -66,7 +66,7 @@ public class TestService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { this.userId = getSharedPreferences("app_situation", MODE_PRIVATE).getString("ID", null); - if (getSharedPreferences("app_situation", MODE_PRIVATE).getString("ID", null) == null) { + if (this.userId == null) { Log.d("onResume", "ID not initialized."); return flags; // IDが初期化されていない場合は何もしない }