After updating application locale of an android app, toast message is showing in previous language

24 Views Asked by At

After setting application locale of an android app, toast message is showing in previous language

Resource string (R.string.somevalue) returns previous language value.

For example, i am in a english language now, and i am changing into arabic now, but toast message is showing in english

Here is the code below :

AppCompatDelegate.setApplicationLocales(
    LocaleListCompat.forLanguageTags(
        "ar"
    )
)

Toast.makeText(this, R.string.language_changed_successfully, Toast.LENGTH_LONG).show()
0

There are 0 best solutions below