0

I have a note editor. I want to be able to paste link in the EditText and make it clickable, but I still want to have the cut/copy/paste menu on long pressing and also I want the link to be opened only if it is clicked, not if I click anywhere else in the EditText. I want to be free to edit the note even if I have links in it. I searched for an answer but didn't understand what to do. Should I use the Linkify class with one of it's add links methods? Please give me an example. I have to complete this task until friday..

user3132352
  • 403
  • 1
  • 9
  • 24

1 Answers1

0

Add the autolink property to the EditText: http://developer.android.com/reference/android/widget/TextView.html#attr_android:autoLink

android:autoLink="true"
Alécio Carvalho
  • 13,481
  • 5
  • 68
  • 74
  • Using this I'm unable to edit the text. I just click anywhere in the edittext and the browsers start. – user3132352 May 16 '14 at 20:57
  • You may have to need the LinkMovementMethod (http://developer.android.com/reference/android/text/method/LinkMovementMethod.html) see some examples of usage: http://stackoverflow.com/a/16644228/684582 – Alécio Carvalho May 17 '14 at 14:08
  • 1
    But I still need the long click listener menu for cut/copy/paste – user3132352 May 18 '14 at 08:42