2

I am trying to find the best way to implement the following:

  • A normal URL would look like https://www.google.com/something/somethingmore/a_lot_more_stuff.html

  • I'd like to display this as google.com/... in my TextView (for better readability)

  • When user clicks on google.com/... in the TextView, the actual long URL should be used automatically for further action

Assuming that I have both the display URL as well as the actual URL with me, how can I use Linkify (or any other technique) to ensure that a very long URL can be displayed in a short fashion, yet when the user clicks on the Linkified URL, the actual long URL is used?

zeiger
  • 700
  • 5
  • 16
  • 1
    AFAIK, `Linkify` cannot handle this, as it does not transform the original text. `Linkify` handles the reverse scenario, where you want to change the URL. You will probably have to set up your own `URLSpan` objects to accomplish your objective. – CommonsWare Sep 24 '12 at 18:49

0 Answers0