Android ClickableSpan not calling onClick

前端 未结 4 1426
有刺的猬
有刺的猬 2020-11-30 18:58

I am creating a ClickableSpan, and it is displaying properly with the proper text underlined. However, the clicks are not registering. Do you know what I am doing wrong???

4条回答
  •  余生分开走
    2020-11-30 19:50

    Have you tried setting the MovementMethod on the TextView that contains the span? You need to do that to make the clicking work...

    tv.setMovementMethod(LinkMovementMethod.getInstance());
    

提交回复
热议问题