如何以编程方式启用“显示触摸"功能. Android中的选项? [英] How to programmatically enable "show touches" option in Android?

查看:252
本文介绍了如何以编程方式启用“显示触摸"功能. Android中的选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Android设备的设置"中启用显示触摸".这里是链接,向我们展示了访问触摸设置"的方法,但是我没有找到访问显示触摸"的方法. 如何以编程方式检查,获取并设置Android手机中的触摸设置?

I want to enable "show touches" in Settings of Android device. Here is the link, which show us the way to access "touch settings", but I didn't find there the way to access "show touches". How to programmatically check, get and set touch settings in android phones?

请帮帮我!

推荐答案

这是我找到的解决方案:

Here is the solution I found:

要启用显示触摸:

Settings.System.putInt(context.getContentResolver(),
                "show_touches", 1);

要禁用显示触摸:

Settings.System.putInt(context.getContentResolver(),
                "show_touches", 0);

请记住要在您的Manifest中添加android.permission.WRITE_SETTINGS.

Remember to add android.permission.WRITE_SETTINGSto your Manifest.

这篇关于如何以编程方式启用“显示触摸"功能. Android中的选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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