Solution to the problem of user permission prohibition error when Android scans QR code

Solution to the problem of user permission prohibition error when Android scans QR code

When I wrote a program to scan QR code with zbardecoder.jar, I did realize the scanning function. The team leader said that if the user prohibits calling the camera, the program can't crash. As a result, I crashed as soon as I ran. I found it on the Internet and it can be solved in this way.

When calling mcameramanager. Opendriver(), rewrite the try.. catch statement and create a new dialog to prompt the user for information. Remember to end with return outside the catch statement.

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>