Search code examples
androidtouchsettings

How to programmatically enable "show touches" option in 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?

Help me, please!


Solution

  • 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.