Talk:How to check whether the application is running

From Nokia Developer Wiki
Jump to: navigation, search
03 Sep
Article Review by kamalakshan (20090903)

Many a times it is required to identify if an application is running or not. This code snippet provides static function for checking the same. It is a very simple and straight forward example and is self explanatory.

Izinin - MySystemUtils::IsApplicationRunningL implementation is incorrect

         TBool situationFlag = apatask.Exists();

Above check for application running is incorrect because according to documentation:

"Tests whether this TApaTask object is empty. This object represents the state of the task at the time at which it was constructed and is not subsequently updated. Therefore, this does not indicate that the task itself exists and should not be used to test whether or not a particular task is running or not. "

thus this function will return 'true' even application of interest has already exited (verified)

izinin 15:34, 22 December 2011 (EET)

Hamishwillee - @Izinin - how would you do this then?

I think this works because the TApaTaskList only returns running applications - so if you find the app you're after in the list and the state is running then it is running. You'd have a problem if you cached the value though.

In any case, IsExeRunning should work for apps as well as other exes.

hamishwillee 06:56, 3 January 2012 (EET)


Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.