【发布时间】:2010-12-27 22:16:18
【问题描述】:
通常这种行为并不引人注目,但在三星 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());
}
【问题讨论】:
标签: android