Android屏蔽Home键代码

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

    @Override  
          public void onAttachedToWindow() {  
                
            super.onAttachedToWindow();  
          //该方法黑屏  
            //this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);  
            //该方法背景透明  
            this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);  
      
          }