Don't linkify empty text

pull/757/head
Alex Baker 6 years ago
parent 7f58aae005
commit 0e8a2e640b

@ -30,6 +30,10 @@ public class Linkify {
} }
public void linkify(TextView textView, Runnable onClick, Runnable onLongClick) { public void linkify(TextView textView, Runnable onClick, Runnable onLongClick) {
if (textView.length() == 0) {
return;
}
BetterLinkMovementMethod.linkify(android.text.util.Linkify.ALL, textView) BetterLinkMovementMethod.linkify(android.text.util.Linkify.ALL, textView)
.setOnLinkClickListener((tv, url) -> handleLink(url, onClick)) .setOnLinkClickListener((tv, url) -> handleLink(url, onClick))
.setOnLinkLongClickListener( .setOnLinkLongClickListener(

Loading…
Cancel
Save