title: Invisible SurfaceView for Camera Preview
body: <p>I need to get camera preview data only, but not visible preview.
  Since I'm doing all this in a service, I had to create a dummy SurfaceView, which works very well.</p>
  
  <p>I've used the code from this answer:
  <a href="https://stackoverflow.com/a/10268650/1395697">https://stackoverflow.com/a/10268650/1395697</a></p>
  
  <p>However, with <code>TYPE_SYSTEM_OVERLAY</code> it didn't work. It was invisible but no preview data was received (in <code>onPreviewFrame()</code>). When I change this argument to 0, I get preview data, but the <code>SurfaceView</code> is visible.</p>
  
  <p>Do you know any other way to do this?</p>
  
  <p>What I did now is just make a visible <code>SurfaceView</code> with width and height of 1 and then I create an <code>ImageView</code> overlay with a specific color so that you don't see the change of color of the <code>SurfaceView</code>. But this isn't neat at all and I'd really like to do it a bit better.</p>