I want to make Habit Number: bold , I tried the HTML tag but it didn't work. I did some research but couldn't find any. Hope someone is able to help me. Thanks!
String habitnumber = "Habit Number: " + String.valueOf(habitcounter);
String Title = habit.getTitle();
String description = habit.getDescription();
//Set text for the row
tv.setText(habitnumber+ "\n" + Title + " \n" + description + "\n --------------------");
I tried the HTML tag but it didn't work
I think that you didnt wrap your string to Html.fromHtml
solution:
You can do it with HTML using html tag for bold: <b>
String habitnumber = "<b>" + "Habit Number: " + "</b> " + String.valueOf(habitcounter);
tv.setText(Html.fromHtml(habitnumber ));
tv.setTypeface(null, Typeface.BOLD);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With