In my app, I change the title in the ActionBar from each fragment displayed. When I first start my apps, I got a list of requests, so my title is \"My requests (20)\".
T
If anyone is still interested in a proper answer after more than 2 years I encountered this problem as well recently and realized the reason is that I updated the title from background thread. In Kotlin using supportActionBar?.title =
.
For some reason the app didn't crash as it usually does with an exception mentioning that you are touching views outside of UI thread. Instead it sets new text, but skips layout pass resulting in wrapping the text.
So either use Activity.runOnUiThread
or View.post
or, when using coroutines as I did, use withContext(Dispatchers.Main)
to trigger the code that updates the title.