Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Implemented with Fragment but when minimize the App, camera preview showing black screen. #250

Open
amit016verma opened this issue Aug 25, 2018 · 3 comments

Comments

@amit016verma
Copy link

Thanku for this demo , its help me alot , but one problem I am facing with that , I have implemented this with the fragment , its working fine everything but when I minimize my app and again open , not showing camera preview and when I click on capture its take the photo easily thats every strange can you help me out from this,

Thanks in Advance .

@dbq4130
Copy link

dbq4130 commented Nov 2, 2018

CameraView:
// if (Build.VERSION.SDK_INT < 21) {
mImpl = new Camera1(mCallbacks, preview);
// } else if (Build.VERSION.SDK_INT < 23) {
// mImpl = new Camera2(mCallbacks, preview, context);
// } else {
// mImpl = new Camera2Api23(mCallbacks, preview, context);
// }

@Bhumik
Copy link

Bhumik commented Feb 14, 2019

It happens in my device also. I am using motorola g5 plus.
When i switch task and again come back to preview screen, it starts showing green solid color screen.

Solution suggested by @dbq4130 is not useful as here we are discarding camera2 api at all.

I think, it's same issue as this one: #183

@dbq4130
Copy link

dbq4130 commented Feb 18, 2019

Thank you. I forgot to paste that code and found the reason. it is createPreviewImpl()

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

No branches or pull requests

3 participants