Application Start Stop when launching

Login to reply to this topic.
Wed, 2005-06-22 15:15
Joined: 2005-05-09
Forum posts: 12
Hello all!

I made an application that can go in the background.

If the application is running in the background and i try to launch the application from the Main Menu again i want the application to close.  Can anyone help me do this??

I tried place a code in the Draw method of the Container class that tests if the application became visible by itself (the app moves from background to foreground after some user inactivity) or if the application became visible by normal launching. But it doesn't work.

Can anyone help me?

Lucian

Thu, 2005-06-23 04:22
Joined: 2004-09-06
Forum posts: 235
Re: Application Start Stop when launching
Close the application when it goes in the background.
void MyAppUi::HandleForegroundEventL(TBool aForeground)

write your application closing code in this function...
Fri, 2005-06-24 08:32
Joined: 2005-05-09
Forum posts: 12
Re: Application Start Stop when launching
Hi Vinay and 10x for your answer.

I think you didn't understand the question.

I want to close the application, that is running in background,  when i try to launch again the app from main menu.

More concise:

1. Main Menu -> Start Application
2. App goes in background and does her stuff
3. Main Menu -> Start Application (that is running in back )   === >  Application in background closes!!!

Any ideas?

Lucian
Fri, 2005-06-24 08:56
Joined: 2005-05-09
Forum posts: 33
Re: Application Start Stop when launching

 Use the HOOK
void MyAppUi::HandleForegroundEventL(TBool aForeground) 

to specify that ur application gone to run in background by some flag,  when u open the application again from main menu same hook will be
called again, so  based on the flag you can restart the application.

The Series 60 framework will notify an application when it gains or looses the screen focus through a call to CAknAppUi::HandleForegroundEventL(TBool aForeground).

see the article: http://www.newlc.com/article.php3?id_article=141

hope this will help u
Fri, 2005-06-24 09:02
Joined: 2005-05-09
Forum posts: 12
Re: Application Start Stop when launching
Hi.

Thank you for the answer.

I don't know how to use HOOK. Can you give me more details.

I used the methods from the article you mentioned to bring the app in back/fore ground

But i don't know exactly how to tell when the application is being reopened (if open the application is brought to foreground) from the main menu. 

Thank you again,
Lucian
  • Login to reply to this topic.