Dim ctxt As JavaObject
ctxt.InitializeContext
Dim PackageManager As JavaObject = ctxt.RunMethod("getPackageManager", Null)
Dim res As JavaObject = PackageManager.RunMethod("getResourcesForApplication", Array("com.google.android.permissioncontroller"))
Dim resId As Int = res.RunMethod("getIdentifier", Array("app_permission_button_allow_always", "string", "com.android.permissioncontroller"))
' Resource string in current lang, whatever it is
Log($"Current ${"app_permission_button_allow_always"} resource string is: ${res.RunMethod("getString", Array(resId))}"$)
' Change locale for resources
Dim LocaleList As JavaObject
LocaleList.InitializeStatic("android.os.LocaleList")
LocaleList = LocaleList.RunMethod("forLanguageTags", Array("it")) '<-- HERE!
Dim currentConfig As JavaObject = res.RunMethod("getConfiguration", Null)
currentConfig.RunMethod("setLocales", Array(LocaleList))
' Deprecated, but still works
res.RunMethod("updateConfiguration", Array( currentConfig, res.RunMethod("getDisplayMetrics", Null)))
' Now it will be in italian
Log($"New ${"app_permission_button_allow_always"} resource string is: ${res.RunMethod("getString", Array(resId))}"$)