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;