0

我在主屏幕的小部件中放置了一个按钮

我想要一种方法,当用户单击小部件时,设备会振动。

我知道这适用于正常活动,但是小部件呢?谢谢

4

1 回答 1

0

You are welcome to have your AppWidgetProvider -- or whatever else is responding to the click on your app widget -- to use the Vibrator system service to vibrate the device. Just bear in mind that not all devices have a vibration motor, and you need to hold the VIBRATE permission to vibrate the device.

于 2013-08-24T17:09:27.267 回答