×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    105

    Detect application exit

    Hi,

    I want to display some msg before the user exit the application. How to detect application exit?

  2. #2
    Regular Contributor
    Join Date
    Oct 2007
    Location
    Pune
    Posts
    189

    Re: Detect application exit

    Hello,

    You either call your message display in destroyApp() method of your midlet.

    OR

    in commandAction() method inside the command from where you are exiting/closing the midlet.
    Regards,
    Dinanath


    It's a matter of attitude.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    105

    Re: Detect application exit

    ok.. destroyApp works.. how to prevent the application from closing at destroyApp? I want to do something like... they user need to enter a correct password before they can exit the application.

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Detect application exit

    On which device you are trying it, most you prevent the call to Destory app() when presses the red key for exit.

    But in case it's you own apps Exit Command, then you can ask this password before call the Destory app().

    thanks,
    Ekta

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Detect application exit

    Avoid doing anything time consuming in destroyApp(). Some devices will limit the amount of time for which destroyApp() is permitted to run, so that destroyApp() cannot block application exit. If the argument to destroyApp() is true, then you cannot stop the application from terminating. If false, then you can throw a MIDletStateChangeException. However, on a red-key exit, the argument will be true, and you will not be able to prevent exit.

    If you simply want a confirmation message when the user picks "exit" from your application's menu, then handle the dialogue as a normal part of the user interface, don't use destroyApp().

    Graham.

  6. #6
    Registered User
    Join Date
    Apr 2008
    Posts
    105

    Re: Detect application exit

    Quote Originally Posted by ektasrv View Post
    On which device you are trying it, most you prevent the call to Destory app() when presses the red key for exit.

    But in case it's you own apps Exit Command, then you can ask this password before call the Destory app().

    thanks,
    Ekta
    Yes! That's exactly what I wanted. Besides exiting the application from the menu command, the user can actually also exit the application by pressing the red key! therefore, I want to display a confirmation dialogue and prevent a call to destroy app if the user do not actually want to exit the application. How to prevent a call to Destroy App()? I am trying on N95 8GB

  7. #7
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Detect application exit

    You cannot prevent the application from being destroyed.

    Preventing an application from being destroyed would present a security issue, as well as compromising platform stability. For these reasons, a MIDlet can always be shutdown by the system.

    Graham.

Similar Threads

  1. S60 application exit on -11
    By ansh.chauhan in forum Mobile Java General
    Replies: 10
    Last Post: 2009-02-27, 10:30
  2. Do Symbian rejects the Express Signing request on any Business Development ground?
    By arpit2agrawal in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 23
    Last Post: 2009-02-19, 10:46
  3. Providing continuous network stream
    By directx in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2008-04-07, 18:41
  4. N70 Reset bug
    By sebboB in forum General Development Questions
    Replies: 2
    Last Post: 2005-12-28, 23:09
  5. Application Error on application Exit
    By yama32 in forum Mobile Java General
    Replies: 0
    Last Post: 2004-09-08, 09:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×