Android + Camera + first launch freezes the app after permissions acquired
-
Case: The app freezes the entire UI, the window is not constructed properly (which contains a full screen QML VideoOutput from Camera with some additions. user has a feeling like he needs to restart his mobile as for some reason the unprepared QT app freezes the entire UI.
When: This happens only the first time the app is launched and AFTER the permissions have been acquired (synchronously and verified) I construct the UI after permissions granted.. Ideas?
Update/Reason: it seems like Application::onPermissionsGranted is NEVER fired after permissions granted when the app i launched for the very first time AFTER privileges acquired, now why would that be? In consecutive runs Application::onPermissionsGranted fires immediately upon launch.
Now, of course I construct UI elements ONLY after such a confirmation acquired.....sadly never happens when launched for the very first time. And the first launch seems like the case when such an event would make sense the most, right?
-
I have encountered the very same problem, but I haven't managed to find a solution for it yet.
I am using QZXing library in my app to scan bar codes.
FWIW:
QZXing defines its native onPermissionGranted / onPermissionDenied static function this way:Any light shed on this matter would be gratefully appreciated, indeed!
-
Case: The app freezes the entire UI, the window is not constructed properly (which contains a full screen QML VideoOutput from Camera with some additions. user has a feeling like he needs to restart his mobile as for some reason the unprepared QT app freezes the entire UI.
When: This happens only the first time the app is launched and AFTER the permissions have been acquired (synchronously and verified) I construct the UI after permissions granted.. Ideas?
Update/Reason: it seems like Application::onPermissionsGranted is NEVER fired after permissions granted when the app i launched for the very first time AFTER privileges acquired, now why would that be? In consecutive runs Application::onPermissionsGranted fires immediately upon launch.
Now, of course I construct UI elements ONLY after such a confirmation acquired.....sadly never happens when launched for the very first time. And the first launch seems like the case when such an event would make sense the most, right?
@Vega4 said in Android + Camera + first launch freezes the app after permissions acquired:
And the first launch seems like the case when such an event would make sense the most, right?
user can remove permission at any time
so you should always before you need the Camera check the permission again - not only at startupand for the first launch you should perhaps show a small window "waiting for Camera Permission..." or so until permission granted