From 81209f695d7377f0a03fbbc57e08983be68176a3 Mon Sep 17 00:00:00 2001 From: it232115 Date: Thu, 11 Jan 2024 10:10:20 +0900 Subject: [PATCH] =?UTF-8?q?QR=E3=83=AA=E3=83=BC=E3=83=80=E3=82=92=E8=B5=B7?= =?UTF-8?q?=E5=8B=95=E3=81=99=E3=82=8B=E5=87=A6=E7=90=86=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=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 --- app/src/main/java/com/example/childguard/QRFragment.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/example/childguard/QRFragment.java b/app/src/main/java/com/example/childguard/QRFragment.java index 7e26151..6209b86 100644 --- a/app/src/main/java/com/example/childguard/QRFragment.java +++ b/app/src/main/java/com/example/childguard/QRFragment.java @@ -11,6 +11,8 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import com.google.zxing.integration.android.IntentIntegrator; + /** * A simple {@link Fragment} subclass. * Use the {@link QRFragment#newInstance} factory method to @@ -74,12 +76,7 @@ public class QRFragment extends Fragment { cameraButton.setOnClickListener(v -> { Log.d("QRFragment", "onClick: called"); - if (!sharedPreferences.getBoolean("inCar", false)) { - editor.putBoolean("inCar", true); - } else { - editor.putBoolean("inCar", false); - } - editor.apply(); + new IntentIntegrator(getActivity()).initiateScan(); }); return view;