使用以下代码: -
android:autoLink="web"
Run Code Online (Sandbox Code Playgroud)
像这样
<TextView
android:id="@+id/txt_post_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:autoLink="web"
android:text=""
android:textColor="@color/wall_msg"
android:textSize="16sp" />
Run Code Online (Sandbox Code Playgroud)
将 textView 中的文本更改为您喜欢的任何内容。并在代码中提供 URL 作为变量
编辑:你说 URL 发生变化:所以只需将 URL 保存在变量中即可。您的应用程序如何接收新网址会很有趣
| 归档时间: |
|
| 查看次数: |
13789 次 |
| 最近记录: |