simple-linkable-text
simple-linkable-text copied to clipboard
Set text to LinkableTextView not working
The snippet below will not update te text displayed on the TextView. It works fine using the LinkableEDITTEXT though
tv = (LinkableTextView) findViewById(R.id.heloworld);
Link linkHashtag = new Link(Pattern.compile("(#\\w+)"))
.setUnderlined(true)
.setTextStyle(Link.TextStyle.BOLD)
.setUnderlined(false)
.setTextColor(Color.DKGRAY);
tv.addLink(linkHashtag);
tv.setText("This does not get set at all");
you need to add .build() instead..
tv.setText("This does not get set at all")
.addLink(linkHashtag)
.build();