0

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?

clement
  • 4,204
  • 10
  • 65
  • 133
  • you should find out why your "little app" takes 70MB (of what?) on your phone. Also you should be more specific what "won't quit" means... – WarrenFaith Jan 02 '12 at 11:26
  • Android will stop your app when there is a need for it (when it is running in the background and the used resources are needed by another app). – THelper Jan 02 '12 at 11:26

2 Answers2

7

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?

Community
  • 1
  • 1
Adil Soomro
  • 37,609
  • 9
  • 103
  • 153
0

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);
}
ChuKoNu
  • 477
  • 4
  • 20