cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RuiBarbosa
Helper I
Helper I

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

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
v-yamao-msft
Community Support
Community Support

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
Helper I
Helper I

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

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

Hello,

 

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

 

Thank you

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,966)