1. Download our Official Android App: Forums for Android!

Apps Killing the appliction

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

  1. eyalm_nm

    eyalm_nm Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    11
    Joined:
    Feb 5, 2010

    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 Android Expert
    Rank:
    None
    Points:
    143
    Posts:
    1,217
    Joined:
    May 29, 2009

    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 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    480
    Joined:
    Feb 4, 2010

    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 Android Expert
    Rank:
    None
    Points:
    143
    Posts:
    1,217
    Joined:
    May 29, 2009

    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 Member
    Rank:
    None
    Points:
    18
    Posts:
    48
    Joined:
    Mar 22, 2010

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

Share This Page

Loading...