I have a problem that when set the title for the action mode for the first time, shortly after it is created, id doesn's show the title. Another request to do that works fine, only the first one. I do this by:
actionMode?.title = text
It is not the problem of actionMode not being initialized, because I checked it (if one closes the actionMode and opens it again, it works perfectly fine). Only the first title is not showing up. My actionMode is set to overlay the toolbar in my app theme like this:
<item name="windowActionModeOverlay">true</item>
If I set it to false, everything is working as it should, showing the title when it should be.
But I really need this actionMode to be overlaying the toolbar.
Have anyone had a similar issue?
Also, the layout consists of CoordinatorLayout inside which there is a RecyclerView. If I wrap the RecyclerView in NestedScrollView the problem seems to disappear.
I created a temporary fix for this, it is not solving the problem but it is working so it kinda does.
Setting a title before I set the actual one seems to solve the issue. It doesn't work if the string is shorter than two characters.