Я установил его в первый раз, оно запросило все разрешения. Затем я удалил его и установил снова, и он не запросил никаких разрешений. Я даже часы перезагружал, а потом устанавливал, разрешения все равно не спрашивают.
Код: Выделить всё
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
// Bind to our service. Views will only update once we are connected to it.
ExerciseService.bindService(requireContext().applicationContext, serviceConnection)
bindViewsToService()
binding.startButton.setOnClickListener {
checkNotNull(serviceConnection.exerciseService) {
"Failed to achieve ExerciseService instance"
}.startExercise()
findNavController().navigate(R.id.exerciseFragment)
}
// Check permissions first.
Log.d(TAG, "Checking permissions")
permissionLauncher.launch(REQUIRED_PERMISSIONS)
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... issions-ag