1首先在AndroidManifest.xml中添加震动权限
- <uses-permission android:name="android.permission.VIBRATE" />
2代码中加入:
Vibrator vib = (Vibrator) this.getSystemService(Service.VIBRATOR_SERVICE);
vib.vibrate(500);
本文转自 netcorner 博客园博客,原文链接:http://www.cnblogs.com/netcorner/p/4666887.html ,如需转载请自行联系原作者