elsni
elsni

Reputation: 2053

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

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).

Upvotes: 5

Views: 674

Answers (1)

Eugene
Eugene

Reputation: 656

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

View.performHapticFeedback

Use stock Haptic feedback

Upvotes: 1

Related Questions