Namespaces

Variants
Actions

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 over the next few weeks. Thanks for all your past and future contributions.

Revision as of 04:33, 30 May 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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
Compatibility
Platform(s): Symbian^3, Symbian Anna
Device(s): All Symbian^3
Article
Created: ashraf fawzy (09 Feb 2012)
Last edited: hamishwillee (30 May 2013)

Introduction

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();
CleanupStack::PopAndDestroy();
if (uid == TUid::Uid(0x102750F0)) // HomeScreen UID
{
// Launched from Homescreen
}
else
{
// Launched from Menu
}

Summary

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.
54 page views in the last 30 days.

Was this page helpful?

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

 

Thank you!

We appreciate your feedback.

×