I have one TextView
. In this view I want to make it as some portion of text is clickable. if you click on that text then I want to open WebView
.
I did the following way:
textView.setText(Html.fromHtml("I have read and agree to the " +
"<a href='id.web.freelancer.example.TCActivity://Kode'>TERMS AND CONDITIONS</a>"));
textView.setClickable(true);
textView.setMovementMethod(LinkMovementMethod.getInstance());
Here if you click on the TERMS AND CONDITIONS
then it opens in the browser but I want to open it in the WebView
.
Another way, borrows a bit from Linkify but allows you to customize your handling.
Custom Span Class:
Helper function:
Usage:
How do I make links in a TextView clickable?
or u can create a linear layout with horizontal orientation having 2 textviews making second textview clickable..
Why don't you make the textView call on onClick method:
And then just have a method in your activity called:
try this may it works
change start and end position according to your text size