在android-Camera2Video示例中创建HandlerThread的内容: https://github.com/googlesamples/android-Camera2Video/blob/master/Application/src/main/java/com/example/android/camera2video/Camera2VideoFragment.java
534行
HandlerThread thread = new HandlerThread(“CameraPreview”); thread.start();
运行后我们不使用线程。
答案 0 :(得分:0)
创建一个HandlerThread将为运行不应该阻止UI的任务添加一个额外的线程。例如,您可以在后台任务中预加载摄像头:
mBackgroundThread = new HandlerThread("CameraBackground");
mBackgroundThread.start();