How to programmatically enable “show touches” option in Android?

淺唱寂寞╮ 提交于 2019-12-17 20:04:30

问题


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?

Help me, please!


回答1:


Here is the solution I found:

To enable show touches:

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

To disable show touches:

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

Remember to add android.permission.WRITE_SETTINGSto your Manifest.




回答2:


if still not works Use solution Given By Top And Change Target Version to 22 in Manifest File. it will work fine Thanks for Answer TOP.



来源:https://stackoverflow.com/questions/26402813/how-to-programmatically-enable-show-touches-option-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!