1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[android]TextViewの中のURLを動的にリンク化する方法

Posted at

textViewの属性に
android:autoLink = "web" を追加するだけ。
このautolink属性は便利で
= の値を "address" "email" だったりにも設定できます

ですがどんな場合にも使えるわけではなく、例えばurlの後ろにスペースが空いてなければその後の文字列も全部リンク化されてしまいます。
その場合にはこちらの記事が参考になります
https://android.gcreate.jp/482/

autoLink公式ドキュメント
https://developer.android.com/reference/android/widget/TextView#attr_android:autoLink

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?