textView中设置多种颜色的文字

利用Html.fromHtml(string);其中string为html格式的文字
实例

agreement=(TextView)findViewById(R.id.TextView1);
String second = "Terms of service,Privacy Policy,Guest Refund Policy ";
String first = "  By signing up,I agree to DropInn ";
String third = "and ";
String fourth = "Host Guaretee Terms.";
agreement.setText(Html.fromHtml(first + second + third + fourth));

你可能感兴趣的:(textView中设置多种颜色的文字)