我的項目需要輔助功能,我需要以編程方式啓用。我正在使用下面的代碼片段。輔助功能啓用在Android果凍豆中不起作用
Settings.Secure.putString(context.getContentResolver(),
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
appInfo);
Settings.Secure.putString(context.getContentResolver(),
Settings.Secure.ACCESSIBILITY_ENABLED,
"1");
Settings.Secure.putString(context.getContentResolver(),
Settings.Secure.TOUCH_EXPLORATION_ENABLED,
"1");
Settings.Secure.putString(context.getContentResolver(),
"touch_exploration_granted_accessibility_services",
appInfo);
但它不工作在5.1操作系統可用的Android設備中。 在較低版本中按預期工作。 4.0後api有什麼變化?
你正在開發一個應用程序或服務? – ChrisCM
我正在開發應用程序。 –
你不能這樣做。您應該考慮開發無障礙服務。這使您能夠正確訪問這些權限。 – ChrisCM