【发布时间】:2020-11-04 13:31:06
【问题描述】:
我在 ButtonView 中使用了自动链接,如下所示,
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/email"
android:autoLink="email"
/>
如果我使用下面这样的字符串,我就可以发送电子邮件了,
<string name="mail"><a href = "abc@gmail.com">abc@gmail.com</a></string>
但是如果我喜欢下面的,不会发生,
<string name="mail"><a href = "abc@gmail.com">Send Mail</a></string>
这就是问题... 但点击按钮没有任何反应...... 当我为 textView 使用自动链接时效果很好.. 但是为什么不为 Button 工作???提前谢谢
【问题讨论】:
-
请分享java代码
-
我在下面回答...试试那个方法
-
因为
abc@gmail.com这不是一个有效的链接 -
@这只是参考...不是实际的电子邮件
-
但该引用应该是有效的链接......不应该是电子邮件地址
标签: android xml android-button autolink