2010-12-10 79 views
1

如何在android中產生搖動(revaberating)效果(類似於PS2,當一輛車遇到障礙時)?搖動Android設備

+0

可能重複[安卓:我想動搖它(http://stackoverflow.com/questions/2317428/android-我想做到換血的話) – 2010-12-28 13:16:17

回答

2
public Vibrator vibrator; 
vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); 
vibrator.vibrate(1000); 

您還需要android.permission.VIBRATE在清單