What Android component can be added to a set of view (TextView
and Button
) to simulate the behavior of a text?
Here is one example in picture of what I expected:
What Android component can be added to a set of view (TextView
and Button
) to simulate the behavior of a text?
Here is one example in picture of what I expected:
You can have a webView
and load it using HTML tags (define a string with the content and then call loadData()
webView method or you can create a Layout
with some TextViews
and custom Buttons
One solution could be that you define your own tag let's say < clickable>. Then if we say that text is:
Hello, this is my < clickable> clickable < /clickable> text.
Then we extend TextView
and override onDraw
method where we draw the text ourselves and needed backgrounds for text's which have the clickable tag set. After that implement the onClickListener
which calculates if clickable text part was clicked.
Not an easy solution, but when implemented, usage is easy and handy allowing all kinds of other requirements implemented as well.
Here is also some help: How to set the part of the text view is clickable