From a69de31fa27aa8a0b21ae1e61c5cb5ac4ba4bc16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 12 Jan 2024 11:55:02 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A2=E3=82=A4=E3=83=86=E3=83=A0=E3=82=92?= =?UTF-8?q?=E3=82=BF=E3=83=83=E3=83=97=E3=81=97=E3=81=9F=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E3=81=AB=E3=82=A2=E3=83=A9=E3=83=BC=E3=83=88=E3=82=92=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/childguard/RecyclerAdapter.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/com/example/childguard/RecyclerAdapter.java b/app/src/main/java/com/example/childguard/RecyclerAdapter.java index ea0eea1..d348ce3 100644 --- a/app/src/main/java/com/example/childguard/RecyclerAdapter.java +++ b/app/src/main/java/com/example/childguard/RecyclerAdapter.java @@ -36,6 +36,17 @@ public class RecyclerAdapter extends RecyclerView.Adapter { Toast.makeText(v.getContext(), deviceList.get(position)[1], Toast.LENGTH_SHORT).show(); + + // アラートダイアログを表示 + new androidx.appcompat.app.AlertDialog.Builder(v.getContext()) + .setTitle("登録") + .setMessage("このデバイスを登録しますか?") + .setPositiveButton(android.R.string.ok, (dialog, which) -> { + // OK button pressed + Toast.makeText(v.getContext(), "OK button clicked", Toast.LENGTH_SHORT).show(); + }) + .setNegativeButton(android.R.string.cancel, null) + .show(); }); }