Tayyab Amin
Tayyab Amin

Reputation: 713

ERROR WHILE ENABLING INPUT METHOD IN ANDROID 14 - ANDROID

In Android Enabling input was working fine before but when I tested in Android 14 (sdk 34), I'm getting following exception.

Fatal Exception: java.lang.SecurityException: Settings key: <enabled_input_methods> is only readable to apps with targetSdkVersion lower than or equal to: 33 at android.provider.Settings$NameValueCache.getStringForUser(Settings.java:3547) at android.provider.Settings$Secure.getStringForUser(Settings.java:9482) at android.provider.Settings$Secure.getString(Settings.java:9448)

Need help

Upvotes: 2

Views: 721

Answers (1)

Muhammad Zahab
Muhammad Zahab

Reputation: 1105

According to android official documentation:

List of input methods that are currently enabled. This is a string containing the IDs of all enabled input methods, each ID separated by ':'. Format like "ime0;subtype0;subtype1;subtype2:ime1:ime2;subtype0" where imeId is ComponentName and subtype is int32.

Note: This setting is not readable to the app targeting API level 34 or higher. use InputMethodManager.getEnabledInputMethodList() instead.

Constant Value: "enabled_input_methods"

Here is the Link of official docs.

Upvotes: 1

Related Questions