question

Simon avatar image
Simon asked

Overwrite LinkMovementMethod

Hey Community, after trying to set a custom LinkMovementMethod to handle ActivityNotFoundExceptions for hours I'm frustrated and hope for help in this forum. I have a TextView with a email address inside final SpannableString s = new SpannableString(" ********@gmail.com"); Linkify.addLinks(s, Linkify.EMAIL_ADDRESSES); tvMail.setText(s); tvMail.setMovementMethod(SafeMovementCheck.getInstance()); and a custom LinkMovementCheck class public class SafeMovementCheck extends LinkMovementMethod { private static SafeMovementCheck sInstance; public static SafeMovementCheck getInstance() { Log.e("TAG", "init custom link movement"); if (sInstance == null) sInstance = new SafeMovementCheck(); return sInstance; } @Override public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) { Log.e("TAG", "ontouch event movement check"); try { return super.onTouchEvent(widget, buffer, event); } catch (Exception ex) { return true; } } } If i start the app on my Fire TV stick the first log gets called ("init custom link movement") but the second gets never called. If i start it on my Android phone both gets called. Why? Does the Fire TV overwrites my custom LinkMovementMethod with it's own custom one or what happens? Simon
fire tv
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Nick Gardner avatar image
Nick Gardner answered
Hi Simon, Thanks for reporting this, we'll look into it and see if there's anything wrong on our end or just something strange going on. Thanks, Nick
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.