0

I'm trying to take a screenshot while using the camera, but it's not happening.
I Searched a lot to find out a solution, but none of the answers gave me exact solution.

My Question is: how can a real Android device (any brand and any model) take a screenshot while using the camera if we're unable to capture a surfaceview?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • Possible duplicate of [How to capture the android device screen content?](https://stackoverflow.com/questions/3067586/how-to-capture-the-android-device-screen-content) – Vladimir Markeev Jun 08 '18 at 07:39

1 Answers1

2

Sorry you can't. The SurfaceView associated to the camera is hardware accelerated so it won't show in your screenshot.

The only solution I came across is to get the preview from the camera and paint it in the SurfaceView programmatically as per this link. Then the screenshot will work.

Rutvik Bhatt
  • 3,185
  • 1
  • 16
  • 28