Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

textIsSelectable property doesn't work with a Toolbar

I have a normal TextView with the android:textIsSelectable property on true. This was working perfectly fine, even while I have the TextView inside of a ListView. But now I decided to use the new Toolbar as my ActionBar and it doesn't work anymore. I don't get a crash or anything, I only see the screen flickering on Lollipop devices when I longPress the TextView. On pre-Lollypop devices I see nothing happening.

Does anybody else have the same issue and is there a fix for it?

like image 314
mennovogel Avatar asked Dec 02 '25 14:12

mennovogel


1 Answers

If you app theme extends one of .NoActionBar themes, you need to enable windowActionModeOverlay, to fix this issue.

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="windowActionModeOverlay">true</item>
</style>
like image 60
Valeriy Katkov Avatar answered Dec 04 '25 05:12

Valeriy Katkov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!