1首先在AndroidManifest.xml中添加震动权限
- <uses-permission android:name="android.permission.VIBRATE" />
2代码中加入:
Vibrator vib = (Vibrator) this.getSystemService(Service.VIBRATOR_SERVICE);
vib.vibrate(500);
1首先在AndroidManifest.xml中添加震动权限
2代码中加入:
Vibrator vib = (Vibrator) this.getSystemService(Service.VIBRATOR_SERVICE);
vib.vibrate(500);