0
有没有人知道为什么我的振动服务在点击Buttons
时出错?它说"....... force close"
。这是我的代码:Android振动器服务错误
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);
}
您很可能在清单中缺少对振动器的许可,但您还需要学习从命令行或ddms或eclipse中的下窗格运行logcat,以便您可以看到开发人员级别的错误消息,而不仅仅是最终用户弹出对话框。 – 2012-04-29 03:29:02
为什么这有一个iPhone标签? – 2012-04-29 04:34:55
这与服务有什么关系? – MikeIsrael 2012-04-29 09:05:30