Skip to content

Commit

Permalink
CheoCharm#68 fix: 퍼미션 요청 시 분기 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyesung82 committed Mar 17, 2023
1 parent f389aa0 commit c379b20
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.cheocharm.presentation.ui.write

import android.Manifest
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.activity.result.contract.ActivityResultContracts
Expand Down Expand Up @@ -69,11 +70,16 @@ class PictureFragment : BaseFragment<FragmentPictureBinding>(R.layout.fragment_p
}

private fun launchPermissionRequest() {
requestPermissionsLauncher.launch(
val permissions = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
arrayOf(
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.ACCESS_MEDIA_LOCATION
)
)
} else {
arrayOf(
Manifest.permission.READ_EXTERNAL_STORAGE
)
}
requestPermissionsLauncher.launch(permissions)
}
}

0 comments on commit c379b20

Please sign in to comment.