How can we open TextView's links into Webview

前端 未结 5 1081
离开以前
离开以前 2020-12-16 17:18

How can I open TextView\'s links into WebView when I click on links of TextView.

5条回答
  •  攒了一身酷
    2020-12-16 17:59

    If you copy a Kotlin solution of nastylion, you can use it like:

    textView.handleUrlClicks { url ->
        Timber.d("click on found span: $url")
        // Call WebView here.
    }
    

    Also you can see an article with its LinkMovementMethod and linkify, but it's too difficult (contains different masks and popup menus).

提交回复
热议问题