How to custom linkify text in android
In my android app there is a page w开发者_StackOverflow社区here I have to display a text - "Terms & Conditions" On clicking this text we need to open a url in the browser Please tell me how to achieve this
May be its helpful to you.
TextView text = (TextView) findViewById(R.id.textView1);
text.settext("Your text with url");
text.setLinkTextColor(Color.BLUE); // color whatever u want
Linkify.addLinks(text, Linkify.ALL);
TextView text = (TextView) findViewById(R.id.textView1);
text.settext("Your text with url means your text value");// text having url
text.setLinkTextColor(Color.BLUE); // color whatever u want
Linkify.addLinks(text, Linkify.ALL);
Hi ankit you will set the text of yours in text view it automatically recognizes the url part of your text and creates the link to that url. if you have still any query feel free to ask :)
simple use setonItemclickListener
for your textview
. And in the click event create an intent to next activity which contains the webView
or use default Action_VIEW
which opens default browser.
精彩评论