simple-linkable-text icon indicating copy to clipboard operation
simple-linkable-text copied to clipboard

Set text to LinkableTextView not working

Open feresr opened this issue 8 years ago • 1 comments

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");

feresr avatar Mar 24 '16 10:03 feresr

you need to add .build() instead..

    tv.setText("This does not get set at all")
       .addLink(linkHashtag)
       .build();

farukprogrammer avatar Jun 25 '16 07:06 farukprogrammer