Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to bold a part of text Android String

i want to bold a part of "" a text but i dont know how this my text:

<string name="apropos"> Le projet Marocherche : Bâtir au cœur d un portail professionnel, destiné aux entreprises marocaines, une création  conçue par des "professionnels pour des professionnels". 

like image 919
Ali Avatar asked May 26 '15 13:05

Ali


1 Answers

Just use like this -

String sourceString = "<b>" + id + "</b> " + name; 
mytextview.setText(Html.fromHtml(sourceString));

If you want to edit string in strings.xml, you can do it as -

<resource>
<string name="styled_welcome_message">We are <b>so</b> glad to see you.</string>
</resources>
like image 81
Narendra Singh Avatar answered Oct 13 '22 02:10

Narendra Singh