Does anyone know why my vibrate service is having an error when I click the Buttons? It says "....... force close". Here’s my code:
final Vibrator mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
public void onClick(View v) {
Intent newgameIntent = new Intent(BodyPartsGameActivity.this,gamelevel.class);
startActivity(newgameIntent);
mp.start();
mVibrator.vibrate(500);
}
You must specify the permission to use the vibrator. Otherwise the security framework will shut down your application.