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.
#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. … }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.