检查触觉反馈电话设置 [英] check phone settings for haptic feedback

查看:203
本文介绍了检查触觉反馈电话设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来检查用户是否启用或在自己的android手机设置中禁用触觉反馈?虽然我认为触觉反馈将是有益的我的应用程序,我也明白,有些人(包括我自己)普遍preFER有触觉反馈关闭。我能找到最接近的是
<一href=\"http://developer.android.com/reference/android/provider/Settings.System.html#HAPTIC_FEEDBACK_ENABLED\" rel=\"nofollow\">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 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.

推荐答案

我设法解决这个问题。这里是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;

这篇关于检查触觉反馈电话设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆