I am trying to implement the per app language feature that was introduced in Android 13. I am using AppCompatDelegate.setApplicationLocales and it's working very well on Android 13. On Android 12 it's working if I use activity context but not application context. The following snippet from an activity produces different output on Android 12.
Log.d(TAG, applicationContext.getString(R.string.settings_change_button))
Log.d(TAG, getString(R.string.settings_change_button))
First line is printed in phone language and second in line is printed in app language. I added the AppLocalesMetadataHolderService as it is shown here https://developer.android.com/guide/topics/resources/app-languages#android12-impl
Should I do something else to get the application context to use the app language?