Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

How to detect if application launched from Home-screen

From Wiki
Jump to: navigation, search

This article explains how to detect if the application has been launched from Home-Screen or Menu.

Article Metadata
Tested with
Devices(s): Nokia E7
Platform(s): Symbian^3, Symbian Anna
Device(s): All Symbian^3
Created: ashraf fawzy (09 Feb 2012)
Last edited: hamishwillee (30 May 2013)


Sometimes when you create an application you want it to do a specific action when user launches it from Home-Screen, and to do another action when user launches it from menu.

Note.pngNote: This method doesn't work on Nokia Belle, as Both Home-screen and Applications Menu has the same UID.

Code Example

TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
TApaTask task = taskList.FindByPos(1);
TInt WgId = task.WgId();
CApaWindowGroupName* wgn = CApaWindowGroupName::NewLC(CEikonEnv::Static()->WsSession(), WgId);
TUid uid = wgn->AppUid();
if (uid == TUid::Uid(0x102750F0)) // HomeScreen UID
// Launched from Homescreen
// Launched from Menu


For example, if you create a memory cleaner application you may want user to add a shortcut of your application on Home-Screen to clean memory with one simple touch / click, and if user wants to access your application to select manually specific actions to clean memory, he / she has to launch your application from Menu.

This page was last modified on 30 May 2013, at 04:33.
59 page views in the last 30 days.