Vibrator mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
mVibrator.vibrate(50);//设置震动时间
权限配置:
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>