[Interest] Preventing iOS/Android device sleep

Nuno Santos nunosantos at imaginando.pt
Mon Feb 22 16:57:26 CET 2016


Jason,

You need to call [application setIdleTimerDisabled:YES/NO];

- (void)applicationWillResignActive:(UIApplication *)application
{
    [application setIdleTimerDisabled:NO];
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    [application setIdleTimerDisabled:NO];
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    [application setIdleTimerDisabled:YES];
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    [application setIdleTimerDisabled:YES];
}

-(void)applicationWillTerminate:(UIApplication *)application
{
    [application setIdleTimerDisabled:NO];
} 

Regards,

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

> On 22 Feb 2016, at 15:51, Jason H <jhihn at gmx.com> wrote:
> 
> I have an app that records video. If the user records more than the display timeout, the display goes black.
> 
> Is there a way in Qt 5.5 or 5.6 to prevent the device sleep? I know android will require a WAKE_LOCK permissions.
> 
> Ideally these this will only be in place while the video recording is active.
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160222/6fdde908/attachment.html>


More information about the Interest mailing list