From 02b4134d41f346ce77939ae4d927253cadde2ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=AF=E9=87=8E?= Date: Fri, 12 Jan 2024 10:26:39 +0900 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E9=96=A2=E4=BF=82=E3=81=AE?= =?UTF-8?q?=E6=A9=9F=E8=83=BD=E3=82=92=E4=B8=80=E9=83=A8=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/childguard/MainActivity.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/example/childguard/MainActivity.java b/app/src/main/java/com/example/childguard/MainActivity.java index 4cd26ee..a391ccc 100644 --- a/app/src/main/java/com/example/childguard/MainActivity.java +++ b/app/src/main/java/com/example/childguard/MainActivity.java @@ -34,8 +34,9 @@ public class MainActivity extends AppCompatActivity { //通知のやつ↓ int importance = NotificationManager.IMPORTANCE_DEFAULT; - NotificationChannel channel = new NotificationChannel("CHANNEL_ID", "サンプルアプリ", importance); - channel.setDescription("説明・説明 ここに通知の説明を書くことができる"); + NotificationChannel channel = new NotificationChannel("CHANNEL_ID", "通報通知", importance); + //説明・説明 ここに通知の説明を書くことができる↓ + channel.setDescription("第3者からの通報を検知しました"); NotificationManager notificationManager = getSystemService(NotificationManager.class); notificationManager.createNotificationChannel(channel); @@ -65,13 +66,13 @@ public class MainActivity extends AppCompatActivity { } //↓通知のやつ - public void notifyTest() { + public void notifyMain() { ((Vibrator)getSystemService(Context.VIBRATOR_SERVICE)).vibrate(1000); NotificationCompat.Builder builder = new NotificationCompat .Builder(this, "CHANNEL_ID") .setSmallIcon(android.R.drawable.ic_menu_info_details) - .setContentTitle("タイトル") - .setContentText("メッセージ・メッセージ") + .setContentTitle("通報検知") + .setContentText("子供の置き去りを検知しました。") .setPriority(NotificationCompat.PRIORITY_DEFAULT); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);