clement
clement

Reputation: 4266

my android app don't close itself

When I test my android application on my phone, the application don't want to quit and make a bug on my phone. My little app take 70MB on my phone and still alive all the day...

How can I close it?

Do I have to put a Listner for the button "return" or there is some methods made from the SDK???

Thanks !

EDIT: My application still runing, even if I press "HOME" ... this is not normal, is it?

Upvotes: 0

Views: 639

Answers (2)

Adil Soomro
Adil Soomro

Reputation: 37729

Application on mobile aren't meant to quit, because it's against the UX of mobile user.

Have a look at this discussion. Android: Is quitting an application frowned upon?

Upvotes: 7

ChuKoNu
ChuKoNu

Reputation: 477

you can override onKeyDown function like this

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if ((keyCode == KeyEvent.KEYCODE_BACK)) {

         finish();
    }
    return super.onKeyDown(keyCode, event);
}

Upvotes: 0

Related Questions