saket / Better-Link-Movement-Method

Attempts to improve how clickable links are detected, highlighted and handled in TextView
Apache License 2.0
780 stars 78 forks source link

Fix long press crash. #10

Closed crazyhitty closed 6 years ago

crazyhitty commented 6 years ago

Don't execute longClickListener if clickableSpanUnderTouch is null. This would prevent the crash when no ClickableSpan is found under the touched location.

Fixes #9

luongvo commented 6 years ago

@Saketme It should be merged soon 👍

saket commented 6 years ago

This change avoids the listener from getting called, but doesn't solve the actual cause of the issue -- the long-press timer listener shouldn't get scheduled in the first place if a long-press isn't made on a clickable span. I will make the necessary changes. Thanks for the idea, @crazyhitty.

crazyhitty commented 6 years ago

Awesome :+1: