Me and a friend of mine are creating a note application for Android. The user must be able to paste a url in the note and when he clicks it -> the browser opens. It has to be something like this: Some text URL more text. URL is clicked in the editText -> the browser opens. I searched for an answer but I didn't found it.
Asked
Active
Viewed 933 times
-1
-
2What did you search? Do you have any attempt at it? [This page may be helpful](https://www.google.com/search?q=clickable+url+in+EditText+android&oq=clickable+url+in+EditText+android&aqs=chrome..69i57j69i60.7408j0j7&sourceid=chrome&es_sm=122&ie=UTF-8) – codeMagic Apr 29 '14 at 14:31
1 Answers
-1
XML:
android:linksClickable="true"
android:autoLink="web|email"
JAVA:
TextView textView = (TextView) findViewById(R.id.textViewId);
textView.setText(Html.fromHtml(html));
textView.setMovementMethod(LinkMovementMethod.getInstance());
[reference] [How can I make links in an EditText clickable?]1