SquareCamera icon indicating copy to clipboard operation
SquareCamera copied to clipboard

Camera activity problem

Open sushovon opened this issue 3 years ago • 1 comments

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.

sushovon avatar Jun 07 '22 09:06 sushovon

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)
    }
}

`

SerjVankovich avatar Jan 05 '23 19:01 SerjVankovich