8

Is there a way to check if the user has haptic feedback enabled or disabled in their android phone settings? While I think haptic feedback would be useful to my app, I also understand that some people (myself included) generally prefer to have haptic feedback turned off. The closest thing I can find is http://developer.android.com/reference/android/provider/Settings.System.html#HAPTIC_FEEDBACK_ENABLED but I'm not sure if it's what I'm looking for or how to test against it.

thank you in advance for whatever help you can provide.

Wookie1120
  • 194
  • 1
  • 11

1 Answers1

9

I managed to resolve it. here is the code I used:

mContentResolver = this.getContentResolver();

int val = Settings.System.getInt(mContentResolver,
                 Settings.System.HAPTIC_FEEDBACK_ENABLED, 0);
mSettingEnabled = val != 0;
njzk2
  • 38,969
  • 7
  • 69
  • 107
Wookie1120
  • 194
  • 1
  • 11
  • 4
    [Settings.System.getInt()](http://developer.android.com/reference/android/provider/Settings.System.html#getInt(android.content.ContentResolver,%20java.lang.String)) should be called in static way. –  Apr 29 '12 at 14:57