Android: how to read system setting for vibration on key presses
How can I programmatically read the system setting for the virtual keybo开发者_运维问答ard? I want my app buttons to behave like it is set in the system settings for the virtual keyboard (beep, vibrate or nothing).
You should use performHapticFeedback
for it. Do not forget to enable it for your views in layout xml.
View.performHapticFeedback
Use stock Haptic feedback
精彩评论