Questions tagged [linkmovementmethod]

This is a Java movement method in the Android API that traverses links in the text buffer and scrolls if necessary. Supports clicking on links with DPad Center or Enter.

A movement method that traverses links in the text buffer and scrolls if necessary. Supports clicking on links with DPad Center or Enter.

Link.

34 questions
11
votes
2 answers

How to make links among other text focusable for accessibility

I have a CheckedTextBox whose text is made up of two SpannableStrings, one of which is a URLSpan. My question is, how do I make so that a user can move the accessibility focus through each span, eventually focusing on the URLspan itself?…
VIN
  • 6,385
  • 7
  • 38
  • 77
8
votes
2 answers

Redirect touch event on TextView with ClickableSpan to parent view

I have a RecyclerView with TextViews that could contain custom hashtags that should be clickable. So I have created subclass of TextView in which using Pattern I create ClickableSpan. In order for ClickableSpan to be active, I have added…
Viktor K
  • 2,153
  • 3
  • 25
  • 40
8
votes
1 answer

Textview`s LinkMovementMethod blocks listitem touch event

I have some problem with Listview. Listview has list items that consist of imageview and textview. Textview contains clickable links. When I set LinkMovementMethod to textviews, listitems doesn`t receive onclick event. I still cannot find any right…
salvicode
  • 227
  • 2
  • 12
7
votes
1 answer

Bold ClickableSpan on touch

I have a TextView in which every word is a ClickableSpan (actually a custom subclass of ClickableSpan). When a word is touched, it should be shown in bold font style. If I set textIsSelectable(false) on the TextView, it works just fine. The word is…
Matt Robertson
  • 2,928
  • 5
  • 34
  • 62
7
votes
5 answers

Android TextView leaks with setMovementMethod

I have a ListView and in it's adapter's getView method, I return a RelativeLayout with MyButton inside it. MyButton has a textView and I have clickable words inside it (ClickableSpan). To make this work, I start with thew following…
frankish
  • 6,738
  • 9
  • 49
  • 100
6
votes
2 answers

How to catch an Exception (ActivityNotFoundException) while using LinkMovementMethod

I have currently a TextView with some HTML phone numbers and url. I have noticed that we can use the setMovementMethod to make these links clickable: tv.setText("Phone number is: +32485123456 and url is…
Waza_Be
  • 39,407
  • 49
  • 186
  • 260
5
votes
2 answers

EditTexts with links both clickable and editable

I am working with EditText which take WebUrl in input.For that I am using LinkMovementMethod Make links in the EditText clickable. Problem is that : If the last part of the text is a link, clicking anywhere causes the link to be opened. I want…
pRaNaY
  • 24,642
  • 24
  • 96
  • 146
4
votes
1 answer

LinkMovementMethod not scrolling TextView

I have a TextView with clickable spannablestrings. I am calling textview.setMovementMethod(LinkMovementMethod.getInstance()); I am able to click individual words but the TextView does not scroll. This is the TextView…
Matt Robertson
  • 2,928
  • 5
  • 34
  • 62
3
votes
1 answer

Intercept link LinkMovementMethod with a Yes/No dialog

I have a standard LinkMovementMethod established in my TextView to push a web Activity of some sort when the user touches a link. However, I want to establish a "do you want to see the link" dialog rather than taking the user straight to the…
QED
  • 9,803
  • 7
  • 50
  • 87
3
votes
0 answers

override LinkMovementMethod textview android

I need to override default LinkMovementMethod. But it's calling the default LinkMovementMethod. Here is the code: class MovementCheck extends LinkMovementMethod { @Override public boolean onTouchEvent(TextView widget, Spannable…
Shubham
  • 3,071
  • 3
  • 29
  • 46
2
votes
0 answers

How to stop a scrollable element from being scrolled any further?

I have this scrollable text where the user is able to scroll so that my name is shown. I want to stop the text from being scrolled any further when the element reaches the middle of the user's screen. Is there any way to do that? Attached below is a…
2
votes
0 answers

How to override link click in TextView to add an action

There is text with HTML tags. Following instructions from other answers, I formatted the text with HtmlCompat and added ClickableSpan and LinkMovementMethod. However, when I click on the link, I only follow it, and the additional actions that I…
2
votes
2 answers

How to get x,y position of clicked span in android TextView?

I have a spannable Textview. I want to show popup window on top of selected span inside TextView. like this: my code is: String definition =…
Hadi Ahmadi
  • 1,924
  • 2
  • 17
  • 38
2
votes
1 answer

TextView#setMovementMethod(LinkMovementMethod.getInstance()) is breaking link display

I have a TextView that I am populating with a Spannable made from some HTML. This code: textView.setText(Html.fromHtml(textContent, mImageGetter, null)); displays links, but they aren't clickable. This…
Andrew Wyld
  • 7,133
  • 7
  • 54
  • 96
1
vote
0 answers

Focus Trapped Inside TextView With LinkMovementMethod When Navigating With Arrow Keys

I have a TextView with the LinkMovementMethod movement method. I have also called Linkify.addLinks(description view, Linkify.ALL) to make links clickable. The issue I am seeing is on Oreo devices (Android 8.0). When navigating the page with hardware…
owenlejeune
  • 135
  • 1
  • 7
1
2 3