Reputation: 1
Is it possible to create a custom camera inside a fragment(not call the android default camera projecting the results onto a "Preview" surface or SurfaceView) and do i need to assign another thread for it?? I am try to create an application which needs an custom camera in a part of my UI
Upvotes: 0
Views: 87
Reputation: 57163
You don't need to worry about a background thread for camera2 API, it is assigned by default (you still can provide custom Handler, if you wish).
Generally, there is no difference whether you open your camera with or without Fragment. Still, you must make sure that the camera is released in Activity.onPause()
. Luckily, for your convenience, this is automatically propagated to your fragment.
Upvotes: 1