'Android - Request accessibility permission on Xiaomi

what is the proper way to request accessibility permission on xiaomi/miui devices programmatically?

The code snippet below on all other devices takes you to the screen with the option to enable accessibility. But on Xiaomi devices it takes to a screen with the following options: "Volume Shortcut", "Accessibility Menu" and "Downloaded Services", and none of these options enable the accessibility system.

Intent intent = new Intent("android.settings.ACCESSIBILITY_SETTINGS");
startActivity(intent);
startActivityForResult(intent, 0);

Thaks a lot!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source