通常情况下,这种行为并不会引起太大的影响,但在三星Galaxy S上,默认的AlertDialog背景是蓝色的,一个普通格式的链接(也是蓝色的)会消失。
不幸的是,下面的代码不能改变链接的颜色。
有人有什么想法吗?
public void showClickableDialog(String title, String msg) {
final SpannableString s = new SpannableString(msg);
Linkify.addLinks(s, Linkify.ALL);
final AlertDialog d = new AlertDialog.Builder(mContext)
.setPositiveButton(android.R.string.ok, null).setIcon(
R.drawable.logo).setTitle(title).setMessage(s).create();
d.show();
// Make the textview clickable. Must be called after show()
TextView textView = ((TextView) d.findViewById(android.R.id.message));
// Next Line unfortunately does nothing
textView.setTextColor(Color.MAGENTA);
textView.setBackgroundColor(Color.BLACK);
textView.setMovementMethod(LinkMovementMethod.getInstance());
}