标签:
<uses-permission android:name="android.permission.VIBRATE" />
public static void sendVibrater(Context mContext) { // 间隔震动 Vibrator mVibrator = (Vibrator) mContext .getSystemService(mContext.VIBRATOR_SERVICE); long[] mPattern = { 200, 200, 200, 200, 200, 200 }; // 震动时间;间隔时间...手机常用的震动都是这样的 // mVibrator.vibrate(pattern, repeat); mVibrator.vibrate(mPattern, 0); } public static void sendVibrate(Context mContext, long mLastTime) { //连续震动 mLastTime 时间 Vibrator mVibrator = (Vibrator) mContext .getSystemService(mContext.VIBRATOR_SERVICE); // mVibrator.vibrate(milliseconds); mVibrator.vibrate(mLastTime); }
标签:
原文地址:http://www.cnblogs.com/fortitude/p/4932491.html