This section explains how to implement Activity Manager.
An
-object of the CUserActivityManager class must be included
-as a member of the component which need to react to activity and inactivity.
-
-
-Create an object of CUserActivityManager.
-
-
-Create an activity callback function implementing the transition to
-device activity.
-
-
-Create an inactivity callback function implementing the transition to
-device inactivity.
-
-
-Call the CUserActivityManager::StartL() function using
-the object of CUserActivityManager. This function accepts
-the following three arguments:
-
-
an integer representing the inactivity interval in seconds,
-
the inactivity callback, and
-
the activity callback.
-
-The callback arguments are instances of TCallBack.
-
-
-Activity manager example#include <activitymanager.h>
-…
-// Activity Manager instance is created and started
-
-void CSomeComponent::ConstructL()
- {
- …
- iActivityManager = CUserActivityManager::NewL( CActive::EPriorityStandard );
-
- iActivityManager->StartL( iTimeout,
- TCallBack( HandleInactiveEvent, this ),
- TCallBack( HandleActiveEvent, this ) );
- …
- }
-…
-// Handles inactive event
-TInt CSomeComponent::HandleInactivityEvent( TAny* aPtr )
- {
- // Code to be executed in case of user inactivity
- …
- }
-
-// Handles active event
-TInt CSomeComponent::HandleActivityEvent( TAny* aPtr )
- {
- // Code to be executed in case of user activity after an inactivity period.
- …
- }
-
-
-Activity
-Manager Overview
+
+
+
+
+
+Activity
+Manager Tutorial
This section explains how to implement Activity Manager.
An
+object of the CUserActivityManager class must be included
+as a member of the component which need to react to activity and inactivity.
+
+
+Create an object of CUserActivityManager.
+
+
+Create an activity callback function implementing the transition to
+device activity.
+
+
+Create an inactivity callback function implementing the transition to
+device inactivity.
+
+
+Call the CUserActivityManager::StartL() function using
+the object of CUserActivityManager. This function accepts
+the following three arguments:
+
+
an integer representing the inactivity interval in seconds,
+
the inactivity callback, and
+
the activity callback.
+
+The callback arguments are instances of TCallBack.
+
+
+Activity manager example#include <activitymanager.h>
+…
+// Activity Manager instance is created and started
+
+void CSomeComponent::ConstructL()
+ {
+ …
+ iActivityManager = CUserActivityManager::NewL( CActive::EPriorityStandard );
+
+ iActivityManager->StartL( iTimeout,
+ TCallBack( HandleInactiveEvent, this ),
+ TCallBack( HandleActiveEvent, this ) );
+ …
+ }
+…
+// Handles inactive event
+TInt CSomeComponent::HandleInactivityEvent( TAny* aPtr )
+ {
+ // Code to be executed in case of user inactivity
+ …
+ }
+
+// Handles active event
+TInt CSomeComponent::HandleActivityEvent( TAny* aPtr )
+ {
+ // Code to be executed in case of user activity after an inactivity period.
+ …
+ }
+
+
+Activity
+Manager Overview
\ No newline at end of file