Android - Vibrating device doesn't work

后端 未结 2 2094
没有蜡笔的小新
没有蜡笔的小新 2020-12-19 07:53

I actually have an app that I test with two devices. One LG GW620, and one Samsung Spica. I would like when User touch the screen, the device vibrate.

In fact, On t

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-19 08:43

    Almost all solutions on the internet seem to missing something . . (context) heres a working solution . . .

        Vibrator v = (Vibrator) getApplicationContext().getSystemService(Context.VIBRATOR_SERVICE);
        v.vibrate(100);
    

提交回复
热议问题