Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe the answer to this is that one must use</p> <pre><code>public final void setPreviewTexture (SurfaceTexture surfaceTexture) Added in API level 11 Sets the SurfaceTexture to be used for live preview. Either a surface or surface texture is necessary for preview, and preview is necessary to take pictures. </code></pre> <p>from <a href="https://developer.android.com/reference/android/hardware/Camera.html" rel="nofollow noreferrer">https://developer.android.com/reference/android/hardware/Camera.html</a> . And from <a href="https://developer.android.com/reference/android/graphics/SurfaceTexture.html" rel="nofollow noreferrer">https://developer.android.com/reference/android/graphics/SurfaceTexture.html</a> :</p> <pre><code>The image stream may come from either camera preview or video decode. A SurfaceTexture may be used in place of a SurfaceHolder when specifying the output destination of a Camera or MediaPlayer object. Doing so will cause all the frames from the image stream to be sent to the SurfaceTexture object rather than to the device's display. </code></pre> <p>and I would really like to try this and send you some code, but I have no phone more recent than gingerbread, and this was introduced with honeycomb.</p> <p>Using a <code>surface</code> associated with an Activity, <code>surfaceDestroyed</code> is called sometime between <code>onPause</code> and <code>onStop</code> when the Activity is being minimised, although, oddly, not when the phone is being put to sleep: <a href="https://stackoverflow.com/questions/11495842/how-surfaceholder-callbacks-are-related-to-activity-lifecycle/13671391#13671391">How SurfaceHolder callbacks are related to Activity lifecycle?</a> But I hope that a <code>surfaceTexture</code> is not destroyed in this way.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload