Moving application in background and foreground
My application works fine . But i want the process to run forever .
So when the user presses exit i put the application to background by the following code .
But my problem is when next time user opens the application , it opens well but does not close.
What can be the solution ? I want the application to move frequently on foreground and background .
Nokia Developer Expert
what do you mean by "it does not close" ?
you mean that you can not exit it ?
Or it does not go background in second try?
Also check that you have derived the applications class from right base (i.e. CAkn.. for Series 60 etc.), so the system takes care not to launch dublicates of your app when user clicks the icon.
Re : Moving application in background and foreground
yucca , my problem is not yet solved .
The application doesnt goes to background when i try it to .
I have written the code in HandleCommandL in appUi.
Also the appui is derived from class CAknAppUi class .
Then what can be the problem ?
here is the code which works fine for me/.
TApaTaskList taskList( iCoeEnv->WsSession() );
TApaTask task( taskList.FindApp( KUidmyApp ));
wgId = task.WgId();
TApaTask task( iCoeEnv->WsSession() );
task.SetWgId( wgId );
I tried your example but I was not able to compile it because I cannot retrieve the Uid of my application. How do you define it? and how do you reference it in the AppUi class.
I am newbie in Series 60
Thank you in advance
You can set ordinal position and ordinal priority like this:
RWindowGroup windowGroup = CEikonEnv::Static ()->RootWin ();
windowGroup.SetOrdinalPosition (KMaxTInt, KMaxTInt);