//屏蔽home键
@Override
public void onAttachedToWindow() {
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
super.onAttachedToWindow();
}
//屏蔽掉Back键
public boolean onKeyDown(int keyCode ,KeyEvent event){
if(event.getKeyCode() == KeyEvent.KEYCODE_BACK)
return true ;
else
return super.onKeyDown(keyCode, event);
}
//调用系统振动
Vibrator vibrator = (Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE);
//振动时长
vibrator.vibrate(200);