diff --git a/Camera2Basic/app/src/main/java/com/example/android/camera2/basic/fragments/PermissionsFragment.kt b/Camera2Basic/app/src/main/java/com/example/android/camera2/basic/fragments/PermissionsFragment.kt index 1d6ceb53..1483ac46 100644 --- a/Camera2Basic/app/src/main/java/com/example/android/camera2/basic/fragments/PermissionsFragment.kt +++ b/Camera2Basic/app/src/main/java/com/example/android/camera2/basic/fragments/PermissionsFragment.kt @@ -40,7 +40,7 @@ class PermissionsFragment : Fragment() { if (hasPermissions(requireContext())) { // If permissions have already been granted, proceed - nativateToCamera(); + navigateToCamera(); } else { // Request camera-related permissions requestPermissions(PERMISSIONS_REQUIRED, PERMISSIONS_REQUEST_CODE) @@ -53,14 +53,14 @@ class PermissionsFragment : Fragment() { if (requestCode == PERMISSIONS_REQUEST_CODE) { if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { // Takes the user to the success fragment when permission is granted - nativateToCamera(); + navigateToCamera(); } else { Toast.makeText(context, "Permission request denied", Toast.LENGTH_LONG).show() } } } - private fun nativateToCamera() + private fun navigateToCamera() { lifecycleScope.launchWhenStarted { Navigation.findNavController(requireActivity(), R.id.fragment_container).navigate(