Open camera inside fragment

后端 未结 2 1278
庸人自扰
庸人自扰 2021-02-15 14:53

Is it possible to use camera in fragment like view, so that it wouldn\'t open another app and go away from my special app?

I want something

2条回答
  •  佛祖请我去吃肉
    2021-02-15 15:30

    Native implementation is way better.

    XML

    
    

    Inside Activity/Fragment

    Start camera

      mCameraView.start();
    

    Stop camera

      mCameraView.stop();
    

    Open source: Google

    Requires API Level 9. The library uses Camera 1 API on API Level 9-20 and Camera2 on 21 and above.

提交回复
热议问题