0

I need to put some text(spanString1) in bold in the textview code and I have done this but does not work:

 SpannableStringBuilder spanString1 = new SpannableStringBuilder (getString(R.string.HOY)); spanString1.setSpan(new StyleSpan(Typeface.BOLD),0,spanString1.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); valor1.setText("¿Qué 3 cosas puedes hacer de aquí a " + spanString2 + " para " + Valor1 + "?"); 

What could I do?

0

1 Answer 1

1

You can do it easily with HTML

String boldone = "your bold text" //get your string here String valor1 = "<b>" + boldone + "</b> " + othertext; yourtextview.setText(Html.fromHtml(valor1)); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.