@Override public void onAttachedToWindow() { super.onAttachedToWindow(); //该方法黑屏 //this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); //该方法背景透明 this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); }
原文地址:http://blog.csdn.net/u014600432/article/details/42638313