autolink
をはじめて使用したので使い方をメモする。
android:autoLink="web"
android:text="詳しくは https://www.google.com/ よりご確認ください。"
android:textColorLink="#0095d9"
<!-- 青色 -->
上記コードのようにautoLink
と1行書くだけで自動でリンク化することができる。
リンクの色はtextColorLink
で指定することができる。
リンクの前後で半角スペースなどを入れておいて、他の文字までリンク化するのを防ぐ。
複数をリンクかしたいときはandroid:autoLink="web|email"
などと書くことによって自動で判別してくれる。