jenly1314 / MLKit

🌝 MLKit是一个强大易用的工具包。通过ML Kit您可以很轻松的实现文字识别、条码识别、图像标记、人脸检测、对象检测等功能。
https://jenly1314.github.io/MLKit/
Apache License 2.0
892 stars 160 forks source link

继承BaseCameraScanFragment后使用导航框架扫描完成后跳转到其他Fragment然后再返回回来,发现是黑屏的,无法继续再扫描,预览都没有了 #27

Closed artillerymans closed 1 year ago

artillerymans commented 1 year ago

有人遇到过这个问题 我已经把开始扫描从新调了一次,还是没有用

artillerymans commented 1 year ago

No supported surface combination is found for camera device - Id : 0. May be attempting to bind too many use cases. Existing surfaces: [SurfaceConfig{configType=PRIV, configSize=PREVIEW}, SurfaceConfig{configType=YUV, configSize=PREVIEW}] New configs: [androidx.camera.core.impl.PreviewConfig@4c4b714, androidx.camera.core.impl.ImageAnalysisConfig@5023bbd]

artillerymans commented 1 year ago

解决方法:

  1. initUI是在 onCreateView 中去初始化的, 我改成在onViewCreated去初始化
  2. releaseCamera 是在 onDestroy里面调用 , 我改成在 onDestroyView去执行