Vibrator的vibrate(long[] pattern, int repeat)方法实现。前一个参数为设置震动的效果的数组,第二个参数为 -1表示只震动一次,为0则震动会一直持续。public static void shake(Context context, long time){ Vibrator vib = (Vibrator)context.getSystemService(Service.VIBRATOR_SERVICE); vib.vibrate(time);//方法一 vib.vibrate(new long[]{1000,10,100,1000}, -1);//方法二 }