From e257038e40dc7d7b88d1358bf0eaf2d6e12abd10 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 16:31:14 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=82=A2=E3=82=B0=E3=83=A9?= =?UTF-8?q?=E3=82=A6=E3=83=B3=E3=83=89=E3=82=B5=E3=83=BC=E3=83=93=E3=82=B9?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E9=96=8B=E5=A7=8B=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/example/childguard/MainActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/childguard/MainActivity.java b/app/src/main/java/com/example/childguard/MainActivity.java index c67c8ea..6947e3b 100644 --- a/app/src/main/java/com/example/childguard/MainActivity.java +++ b/app/src/main/java/com/example/childguard/MainActivity.java @@ -136,6 +136,8 @@ public class MainActivity extends AppCompatActivity { } registerReceiver(receiver, intentFilter); + startForegroundService(new Intent(this, TestService.class)); + } @@ -334,8 +336,8 @@ public class MainActivity extends AppCompatActivity { @Override public void onStop() {//アプリをバックグラウンドにした時のメソッド super.onStop(); - Intent intent = new Intent(getApplication(), TestService.class); - startService(intent);//TestServiceを起動 +// Intent intent = new Intent(getApplication(), TestService.class); +// startService(intent);//TestServiceを起動 } public void NotificationBluetooth(Context context) {//実際に通知を行うメソッド