Disable home button in android

后端 未结 1 1690
南旧
南旧 2021-01-29 02:50

I add this code in my activity

public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_HOME) {
            return false;
         


        
相关标签:
1条回答
  • 2021-01-29 03:34

    You should absolutely not be disabling the home button in an Android application. This is a major anti-pattern, and will both make your app labelled as spammy and malware-like. Users hate when you disable their home button, and you should really avoid it at all costs. (At the very least, it will get you poor market ratings.)

    0 讨论(0)
提交回复
热议问题