cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RuiBarbosa
Level: Powered On

Problem with onVisble not triggering after suspension

Hello all,

 

I have a timer control and when I suspend my mobile phone the timer stops counting. 

I can save the DateTime when the user press the start button, and when he open the mobile after suspension I can subtract times (ActualTime - SavedTime) and change the attribute Text in Timer.

The problem is that, after I suspend my device and turn it on again, the "on visible" attribute doesn't trigger, so there's no way for me to subtract the times without user interaction, like said above.

 

Someone can help me with that?

 

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RuiBarbosa
Level: Powered On

Re: Problem with onVisble not triggering after suspension

If this problem appear to someone, here's the solution:

 

In Timer control text, make a difference with Now() (hh:mm:ss) and the variable that you saved the created time, in my case, it was in sharepoint list.

 

Rui Barbosa

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Problem with onVisble not triggering after suspension

Hi RuiBarbosa,

 

How is your OnVisible property configured? I am not sure with that.

 

Have you set the AutoStart property of the timer to True?

 

Please try to set the OnVisible property as: UpdateContext({run:true}), then set the AutoStart property of the Timer control as: run.

 

Then whenever you open the screen, the timer will run and will not stop working.

 

Hope this could be a reference for you.

 


Best regards,
Mabel Mao

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
RuiBarbosa
Level: Powered On

Re: Problem with onVisble not triggering after suspension

Hey there,

The problem is not that the timer doesn't start automatically. I'll give you an example:

If I'm running my app and then I suspend my phone when the timer is at 10 seconds, if I then wait 5 seconds while the app is suspended, when I re-open it, I want the timer to be at 15 seconds, but it won't! Because it stops at 10 and only procedes when I re-open the app.

I can't do that with the onvisible property because it doesn't trigger when I open the app after suspending the phone, only if I close the app entirely and re-open it.

Best regards
RuiBarbosa
Level: Powered On

Re: Problem with onVisble not triggering after suspension

If this problem appear to someone, here's the solution:

 

In Timer control text, make a difference with Now() (hh:mm:ss) and the variable that you saved the created time, in my case, it was in sharepoint list.

 

Rui Barbosa

View solution in original post

yuliamamonova
Level: Powered On

Re: Problem with onVisble not triggering after suspension

Hello,

 

Can you please write the whole function text? Text(Now(),"hh:mm:ss")? What else?

 

Thank you

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,970)