Camera activity problem
when I go to the camera and after taking the image the tick arrow and cross button appeared, but when I click on the tick button the image is not getting back to the activity. It stayed in the camera activity.
This issue is reproduced because you have not got read/write storage permissions. To solve this add
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
to your AndroidManifest.xml and request it like:
`
private fun requestCameraPermissions() {
val cameraPermission = Manifest.permission.CAMERA
val readStoragePermission = Manifest.permission.READ_EXTERNAL_STORAGE
val writeStoragePermission = Manifest.permission.WRITE_EXTERNAL_STORAGE
if (ContextCompat.checkSelfPermission(this, cameraPermission) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, listOf(cameraPermission, readStoragePermission, writeStoragePermission).toTypedArray(), REQUEST_CAMERA_PERMISSION)
} else {
val startCameraIntent = Intent(this, CameraActivity::class.java)
startActivityForResult(startCameraIntent, CAMERA_REQUEST)
}
}
`