Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actionbar language stays to default language on Android Nougat #1

Open
toteto opened this issue Mar 2, 2017 · 2 comments
Open

Actionbar language stays to default language on Android Nougat #1

toteto opened this issue Mar 2, 2017 · 2 comments

Comments

@toteto
Copy link

toteto commented Mar 2, 2017

I have changed the locale with call to onAttach(context) on my Application and on my base AppCompatActivity that every other Activity extends.

On Android API < 24 (Kitkat, Lollipop, Marshmallow) it works great.

On Android 24 and 25 the content of the whole activity is on the desired language. Unfortunately the language of the actionbar is on the device preferred language.

I have debugged a bit and this methods are called from the system:
Activity.onPostCreate -> Activity.onTitleChanged(getTitle(), getTitleColor())

Here Activity.getTitle() returns Activity.mTitle which is the title on the prefered system language.

Only (bad)workaround i found is store the string id for the activity, and call Activity.setTitle(StringResId) on onCreate

@felixwiemuth
Copy link

Had exactly the same problem. However, I don't think it is a bad workaround because it is just an alternative way of setting the title (instead of setting it in AndroidManifest.xml).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants