1

How can I stop the activity of an android app to alter by home button. Like the app should be in the same activity eventhough any button is pressed as in the lock mode of mx player. I used the traditional following method.

public boolean onKeyDown(int j, KeyEvent keyevent)
    {
        if (j == 3)
        {
            //KEYCODE_HOME
            return false;
        } else
        {
            if (j == 4)
            {
                //KEYCODE_BACK
                return false;
            }
            if (j == 82)
            {
                //KEYCODE_MENU
                return false;
            }
        }
        return false;
    }

It worked for back button but its not working for home button. Please somebody help me here

Tip
  • 21
  • 4
  • While some things are possible, some things may not be [helpful design decisions](http://stackoverflow.com/a/20945431/1167750). – summea Jun 22 '15 at 17:16

0 Answers0