Solution to the problem of user prohibiting permission error when scanning QR code on Android
When I wrote a program that scans QR code, the scanning function was indeed implemented. The team leader said that if the user prohibits calling the camera, the program cannot crash. As a result, I crashed as soon as I ran. I searched for it online and it can be solved in this way.
try { (); } catch (Exception e) { // When the user manually bans camera permissions, prevent the system from crashing builder=new (this); (.camera_camcel_title); (.camera_camcel_content); (false); (, new () { @Override public void onClick(DialogInterface dialog, int which) { (); finish(); } }); ().show(); return; // (); }
When calling (), rewrite the try..catch statement, create a new dialog and prompt the user for information. Remember to return to the end of the catch statement.
Thank you for reading, I hope it can help you. Thank you for your support for this site!