まちがえてrequireActivityを使っていたので修正

This commit is contained in:
ろむねこ 2023-12-20 12:13:06 +09:00 committed by ろむねこ
parent 0bf6b3fa1a
commit 8e97dd6972

View File

@ -68,7 +68,7 @@ public class ScannerDataManagerStubFragment extends Fragment {
view.findViewById(R.id.button_call_camera).setOnClickListener(v -> { view.findViewById(R.id.button_call_camera).setOnClickListener(v -> {
Log.d("ScannerDataManagerStubFragment", "button_call_camera clicked"); Log.d("ScannerDataManagerStubFragment", "button_call_camera clicked");
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(requireActivity().getPackageManager()) != null) { if (takePictureIntent.resolveActivity(getActivity().getPackageManager()) != null) {
Log.d("ScannerDataManagerStubFragment", "camera available"); Log.d("ScannerDataManagerStubFragment", "camera available");
cameraLauncher.launch(takePictureIntent); cameraLauncher.launch(takePictureIntent);
} }