Skip to content

Actionbar language stays to default language on Android Nougat #1

@antonio-ivanovski

Description

@antonio-ivanovski

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions