也请看代码吧:
//这个放类里 private Vibrator vibrator = null; //震动,这个Long数组是震动的间隔和强度,那个2是重复震动 long[] pattern = {1000,1000,1000,1000}; vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE); vibrator.vibrate(pattern, 2); //退出时候需要释放vibrator,我直接放onDestory()里了 vibrator.cancel();
最后也是在manifest里加入权限:<uses-permission android:name="android.permission.VIBRATE"/>