×
Namespaces

Variants
Actions

Keeping the current running application on the foreground when the Nokia N93 device rotates from portrait to landscape screen orientation

From Nokia Developer Wiki
Jump to: navigation, search



Article Metadata
Tested with
Devices(s): Nokia N93
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Article
Created: User:Technical writer 2 (30 Nov 2006)
Last edited: hamishwillee (14 Jun 2012)

Overview

Keeping the current running application on the foreground when the Nokia N93 device rotates from portrait to landscape screen orientation

Description

Normally the native camera application will be on the foreground instead of the current running application when the Nokia N93 device rotates from portrait to landscape screen orientation, but sometimes it is not convenient for the user. Here is a workaround to keep the current running application on the foreground. Please note that the latency is a bit long. The example code is below:
MCoeForegroundObserver::HandleLosingForeground()
{
  const TUid KNativeCameraAppUID = { 0x101ffa86}; //The UID of the native camera application
  TUid id( KNativeCameraAppUID);
  TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
  TApaTask task = taskList.FindApp( id );
  if ( task.Exists() )  //If the native camera application is running
  {
      RWsSession WsSession = CCoeEnv::Static()->WsSession();
          TWsEvent event;
          TInt ForegroundWinGroup = WsSession.GetFocusWindowGroup();
          if (task.WgId()==ForegroundWinGroup)   //If the native camera application is on the foreground
     {
         const TUid KCurrentAppUID = { 0x20004A79 }; //The UID of current runing application
               TUid thisid( KCurrentAppUID );
               TApaTaskList taskList1( CEikonEnv::Static()->WsSession() );
               TApaTask task1 = taskList1.FindApp( thisid );
               if ( task1.Exists() )
               {
                      task1.BringToForeground();
               }
          }
    }
}

This page was last modified on 14 June 2012, at 10:15.
39 page views in the last 30 days.
×