1. Check out our companion app, Forums for Android! Download from Google Play

Killing the appliction

Discussion in 'Application Development' started by eyalm_nm, Apr 15, 2010.

  1. eyalm_nm

    eyalm_nm Member
    Thread Starter
    15

    Feb 5, 2010
    11
    0
    15
    I'd like to kill my app whenever the user use the Exit item in my app's menu.
    How it can be done?
    Currently, I'm using System.exit(0). But, the result of using it, is rerun the application.
    Thanks,
    Eyal.
     

    Advertisement

  2. KlaymenDK

    KlaymenDK Well-Known Member
    143

    May 29, 2009
    1,217
    130
    143
    Denmark
    Well, according to the Android application life cycle, onDestroy() is the last thing to be called before the app finally dies, and I read that it responds to, for instance, a call from YourActivity.finish().

    Hope that helps...
     
    eyalm_nm likes this.
  3. antipesto93

    antipesto93 Well-Known Member
    43

    Feb 4, 2010
    480
    35
    43
    Bump - the Chinese spam message above this is messing up the forum homepage...so i had to bump a thread to get rid of it :)
     
  4. KlaymenDK

    KlaymenDK Well-Known Member
    143

    May 29, 2009
    1,217
    130
    143
    Denmark
    That's not the way to solve things... :rolleyes: I hope you at least clicked "[​IMG]Report post"?
    I've now trashed 7 chinese spam posts. :mad:
     
  5. gorn

    gorn Well-Known Member
    18

    Mar 22, 2010
    48
    11
    18
    Code (Text):
    1. this.finish();
    might be what you are looking for
     

Share This Page

Loading...