摘要:
1.添加震动权限2.获取震动服务Vibrator mVibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);3.启动震动void vibrate(long milliseconds);// 震动一次,震动时长为milliseconds例:mVibrator.vibrate(1000);// 震动一次,震动时长为1000msvoid vibrate(long[] pattern, int repeat);// pattern控制震动周期,repeat=-1时,震动只出现一次;repeat=0时,震动一直持续,必须手动取消例:mVibrat 阅读全文