Summary: Take a picture utilizing Camera Intent and display the photo with correct orientation (works on hopefully all devices)

前端 未结 4 1375
野性不改
野性不改 2020-11-27 15:02

It seems to be the simplest thing in the world: taking a picture within your Android app using the default camera activity. However, there are many pitfalls which are covere

4条回答
  •  佛祖请我去吃肉
    2020-11-27 15:18

    I experience some problems when using this with Sony Xperia Z5.

    I added this and it got a lot better.

    if (buildType.contains("sony")&& buildDevice.contains("e5823")) {
                    setPreDefinedCameraUri = true;}
    

    But 4 times out of 22 it restarted the camera and once it restarted two times. I restarted the App due to every test. Is there some way to get around this or do I accept this result?

    The thing is that if the camera restarts I can press the back button twice and boom, the image is there in my Imageview and saved

提交回复
热议问题