0

Our app is crashing (it says "application has stopped) after we longpress the home button on samsung galaxy s3 (the longpress button is used to popup the multitasking screen/app switch dialog) we do not have this problem on our another testing device htc evo 3d so what is the keycode for this "action" ? and how can we disable this function ?

This code sadly does not work:

public boolean onKeyDown(int keyCode, KeyEvent event) {
    if(keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
        System.exit(0);
            return false;
    }
    return super.onKeyDown(keyCode, event);
}   
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Petr Župka
  • 111
  • 2
  • 9
  • You shouldn't be trying to do that (hopefully it is not possible). Don't try to disable basic Android functionality, rather fix the actual problem in your code causing your crash. – Chris Stratton Oct 24 '14 at 18:42
  • and do you know where might be the problem ? – Petr Župka Oct 24 '14 at 18:45
  • 1
    No, because I don't have you app. Collect a stack trace of the failure, and rewrite your question to be about solving the problem indicated there. – Chris Stratton Oct 24 '14 at 18:47
  • Most probably your app is crashing when it is entering the onPause(), you should check the logcat, stacktrace, publish them here, as this might happen on other devices. Disabling a standard OS functionality is not a solution. – Cornel Oct 24 '14 at 20:33

0 Answers0