J jimpmathew New Member Licensed User Longtime User Dec 16, 2012 #1 How to know the user’s inactivity from an application. Actually if user is inactive for a period I have to trigger some code. How can I do this. Please help.
How to know the user’s inactivity from an application. Actually if user is inactive for a period I have to trigger some code. How can I do this. Please help.
NJDude Expert Licensed User Longtime User Dec 16, 2012 #2 You will need a timer and reset it everytime there's some action, the attached sample displays a message box if the user has been inactive for 10 seconds. Attachments InactivitySample.zip InactivitySample.zip 10.2 KB · Views: 296 Upvote 0
You will need a timer and reset it everytime there's some action, the attached sample displays a message box if the user has been inactive for 10 seconds.
J jimpmathew New Member Licensed User Longtime User Dec 16, 2012 #3 Thank you for the quick reply. It was really helpful. But I have so many panels and buttons in my application. Do I need to write the reset code on all the button and panels click events? Is there any simple way to do this? Upvote 0
Thank you for the quick reply. It was really helpful. But I have so many panels and buttons in my application. Do I need to write the reset code on all the button and panels click events? Is there any simple way to do this?
NJDude Expert Licensed User Longtime User Dec 16, 2012 #4 No, that's the way it has to be done, how else can you determine the user is actually using the app?, if there's another way, I'd like to know also. Upvote 0
No, that's the way it has to be done, how else can you determine the user is actually using the app?, if there's another way, I'd like to know also.
Erel B4X founder Staff member Licensed User Longtime User Dec 17, 2012 #5 Maybe ScreenOff event from PhoneEvents? Upvote 0
M melamoud Active Member Licensed User Longtime User Dec 17, 2012 #6 touch event it might be good enough to override this sub and update the last visit time Code: Copy Sub Activity_Touch (Action As Int, X As Float, Y As Float) lastTimeAlive = DateTime.Now End Sub of course you need to set the timer, and remember to shut it down on activity pause sub, and turn it on on resume sub, etc Upvote 0
touch event it might be good enough to override this sub and update the last visit time Code: Copy Sub Activity_Touch (Action As Int, X As Float, Y As Float) lastTimeAlive = DateTime.Now End Sub of course you need to set the timer, and remember to shut it down on activity pause sub, and turn it on on resume sub, etc