如何设置android:autoLink="web"
可以在类内的 XML 中设置,例如对于这个 textView
final TextView finalTv;
finalTv.setMovementMethod(testCase);
根据 Android 文档,您应该使用 TextView setAutoLinkMask
( https://developer.android.com/reference/android/widget/TextView.html#setAutoLinkMask(int) ),传入以下枚举之一:
https://developer.android.com/reference/android/text/util/Linkify.html#ALL
对于网络,您可能希望使用此值: https ://developer.android.com/reference/android/text/util/Linkify.html#WEB_URLS