Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera activity problem #79

Open
sushovon opened this issue Jun 7, 2022 · 1 comment
Open

Camera activity problem #79

sushovon opened this issue Jun 7, 2022 · 1 comment

Comments

@sushovon
Copy link

sushovon commented Jun 7, 2022

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.

@SerjVankovich
Copy link

SerjVankovich commented Jan 5, 2023

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

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants