android camera2开发异常,不能拍照. maxImages (2) has already been acquired, call #close before acquiri

android相机开发Camera2不能拍照超过2张,提示:
java.lang.IllegalStateException: maxImages (1) has already been acquired, call #close before acquiring more.

ImageReader.setOnImageAvailableListener(reader -> {
	// 拿到拍照的数据
	Image image = reader.acquireNextImage();
	// 需要在这个事件监听里面调用close要不然会报上面的错误
	 image.close();
});

也可以在保存后再关闭.

你可能感兴趣的:(arduino)