问题描述
有没有一种方法来检查用户是否启用或在自己的android手机设置中禁用触觉反馈?虽然我认为触觉反馈将是有益的我的应用程序,我也明白,有些人(包括我自己)普遍preFER有触觉反馈关闭。我能找到最接近的是
http://developer.android.com/reference/android/provider/Settings.System.html#HAPTIC_FEEDBACK_ENABLED
但我不知道这是否是我正在寻找,或如何测试反对票。
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 ishttp://developer.android.com/reference/android/provider/Settings.System.html#HAPTIC_FEEDBACK_ENABLEDbut 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.
推荐答案
我设法解决这个问题。这里是code我用:
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;
这篇关于检查触觉反馈电话设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!