我的目标是让AlertDialog
中显示的消息文本中有可点击的超链接。虽然AlertDialog
实现可以很好地为任何超链接(在传递给Builder.setMessage
的字符串资源中使用<a href="...">
进行定义)添加下划线和颜色,但这些链接无法被点击。
我当前正在使用的代码如下:
new AlertDialog.Builder(MainActivity.this).setTitle(
R.string.Title_About).setMessage(
getResources().getText(R.string.about))
.setPositiveButton(android.R.string.ok, null)
.setIcon(R.drawable.icon).show();
我想避免使用 WebView
来仅显示文本片段。