dimanche 22 mars 2015

Provide vibration feedback based on whether the checkbox are checked or not

I am trying to developing a setting list for my app and basically I wanna have a checkbox in my settings which allow user to decide whether or not to allow vibration in the app.


To implement vibration effect in my app when the checkbox is checked is quite simple but I just could not find a way to give user instant vibration feedback when user is checking the checkbox in setting. Specifically speaking, I wanna the device vibrate when the user check the checkbox and of course dont vibrate when the user uncheck it.


Below is my checkbox preference block which should be very commom: enter image description here


And the preference class which load the preference xml:


enter image description here


Please anyone kindly tell me how could I achieve this. Thx!





Aucun commentaire:

Enregistrer un commentaire