代碼:
StringBuilder sb = new StringBuilder();
sb.append(String.format("<b>%s. %s</b> %s", Integer.toString(id), name, description));
derp.setText(sb.toString());
返回結果:
< b>id. name< /b> description
期望結果:
id. name description
sb.append(String.format("%s. %s %s", Integer.toString(id), name, description));
derp.setText(Html.fromHtml(sb.toString()));
這樣應該能達到你要的效果