Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set text to LinkableTextView not working #9

Open
feresr opened this issue Mar 24, 2016 · 1 comment
Open

Set text to LinkableTextView not working #9

feresr opened this issue Mar 24, 2016 · 1 comment

Comments

@feresr
Copy link

feresr commented Mar 24, 2016

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");
@farukprogrammer
Copy link

you need to add .build() instead..

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants