1.权限
View Code
<uses-permission android:name="android.permission.VIBRATE"/>
2.初始化,实现
View Code
mVibrator01 = (Vibrator)getApplication().getSystemService(Service.VIBRATOR_SERVICE); clickListener = new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.btnShort: mVibrator01.vibrate(new long[]{1000,1000,1000,1000,1000,10000},-1);//静止的时长,震动时长,静止时长,震动时长,-1 不重复震动,1 重复震动 break; default: break; } }