How to get notification of user activity when the device has been idle
This article shows how to get a notification of user activity when the device has been idle
Article Metadata
Compatibility
Platform(s): S60 platform
Series 80 1st Edition
Series 80 2nd Edition
Series 80 1st Edition
Series 80 2nd Edition
Article
Created: User:Technical writer 2
(21 Jul 2005)
Last edited: hamishwillee
(20 Nov 2012)
Description
How to implement a mechanism that gives an application a notification of user activity when the device has been idle?
Solution
Write an "Activity Manager" CTimer that monitors InactivityTime. When the CTimer launches, do
TTimeIntervalSeconds inactiveTime = User::InactivityTime();
if (inactiveTime < KMyActivityManagerTimerInterval)
{
CTimer::Cancel();
NotifyApplicationOfUserActivityL();
}
Summary
You can implement an "Activity Manager" by using CTimer. When the timer launches, compare the timer interval to Inactivity Time. If the Inactivity Time is smaller than the timer interval, you know that there has been activity while the timer was counting.


(no comments yet)