Although I know there are hundreds of posts in stackoverflow regarding this post still, I did not found my appropriate answer. So I am asking it as new question.
Problem:- I have a text in text view "You need cookies or banana to eat?" I want that if any one click on banana or cookies then only it should go to Kitchen screen. If clicked on other word it should not react.
My Try:- I am doing it from text view, android:clickable="true"
but complete line is getting clickable.
So I decided to break it into various text views, and used relative layout but again there was a problem that complete line was not coming in center of screen.When I hard coded it as android:layout_marginLeft="150dp"
but then indentation disturbs for portrait and landscape. and obviously we should not hard code the values. Apart from that to give a clear view to user I need to do some formatting to banana and cookies like bold and underlined and some color. Although I used and tag for bold and underline, how to color the text.?
Lastly I should summarize my problems as
1) How to make some word in a complete string clickable (not url links)
2) How to do formatting of few text of complete string.
3) If relative layout is used how to keep the entire string in center.
If any other approach can b used they are also welcomed
Point to note that these all are not url links but internal screens. So please if any one could help. Any help will be appreciated. Thanks in advance.