Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: how to read system setting for vibration on key presses

Tags:

android

How can I programmatically read the system setting for the virtual keyboard? I want my app buttons to behave like it is set in the system settings for the virtual keyboard (beep, vibrate or nothing).

like image 628
elsni Avatar asked Nov 14 '22 07:11

elsni


1 Answers

You should use performHapticFeedback for it. Do not forget to enable it for your views in layout xml.

View.performHapticFeedback

Use stock Haptic feedback

like image 121
Eugene Avatar answered Dec 26 '22 03:12

Eugene