Camera preview still black

前端 未结 3 825
你的背包
你的背包 2021-01-01 05:59

I\'m trying the camera preview on my Android applications. When I try on my real devices, it gives me black screen.

This is my code and it doesn\'t throw any error,

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-01 06:41

    Bit of an odd issue I've just found relating to black camera preview. In my case it turned out to be because I had the manifest options

    PARTIAL_WAKE_LOCK and also REQUEST_INSTALL_PACKAGES

    
    
    

    Why these affect the camera like this I don't know - or whether it's just related to the device I'm using - but removing these permissions resolved my issue. It's taken me 2 hours of stripping a project down to figure out where the issue came in!

提交回复
热议问题