TextView clickableLinkTextView= (TextView) findViewById(R.id.tvHtmlLink); clickableLinkTextView.setText(getString(R.string.my_blog_link));
Next step is apply pattern on that URL which you want to open in Browser and pattern in Linkify.
For more information about Linkify
Pattern pattern = Pattern.compile(getString(R.string.link)); Linkify.addLinks(clickableLinkTextView, pattern, "https://");
Your link is clickable and the user is able to navigate to the url using the browser. This is the most basic example of Linkify
No comments:
Post a Comment