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

Accessibility issue with reference URL #35

Closed abhi007tyagi closed 1 year ago

abhi007tyagi commented 4 years ago

If we pass incomplete reference URLs in <a href> tags and capture the URLs and map them to correct methods or activities, it works. But when accessibility is ON it fails and we get error W/URLSpan: Actvity was not found for intent, Intent { act=android.intent.action.VIEW dat=/wps/portal/CONTACT_US (has extras) }

How to handle such issues?

saket commented 4 years ago

This doesn't sound like an issue with this library. Just to confirm: do you run into this error even when using vanilla LinkMovementMethod?

abhi007tyagi commented 4 years ago

Well, we can't use the vanilla method as that can't help our use case.

abhi007tyagi commented 4 years ago

Following method is called in normal use, but in accessibility state ON it is not called. The onClick is never called in talkback or switch access modes.


method.setOnLinkClickListener((textView, url) -> {
  // Do something with the URL and return true to indicate that 
  // this URL was handled. Otherwise, return false to let the 
  // framework handle the URL.
  return true;
});
saket commented 1 year ago

Closing this because the issue was unrelated to BetterLinkMovementMethod