clickable word inside TextView in android

后端 未结 6 2075
谎友^
谎友^ 2020-12-04 19:36

I have TextView with text that changed dynamically. This text contain strings like myWord. I want that after click to this \"

6条回答
  •  忘掉有多难
    2020-12-04 20:05

    The best workaround I know is to create your own Button class. You could make the Button have a transparent background so that only the text is seen by the user. Then when the Button is pressed down change the TextColor and TextStyle of the button to be a darker color and underlined. This will work exactly as a link does. You can then use startActivity to go to the appropriated activity. You should not use hyperlinks to connect to other activities within your application.

提交回复
热议问题