android text bold code example

Example 1: android font bold xml

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textStyle="bold"
    android:text="@string/app_name"
    android:layout_gravity="center" 
/>

Example 2: how to set text style to bold in android programmatically

textView.setTypeface(null, Typeface.BOLD_ITALIC);
textView.setTypeface(null, Typeface.BOLD);
textView.setTypeface(null, Typeface.ITALIC);
textView.setTypeface(null, Typeface.NORMAL);

Example 3: html bold text

<html>
 <head>
   <title>Bold text</title>
 </head>
 <body>
   <p>Use the strong element to <strong>indicate strongly emphasized</strong> content.</p>
 </body>
</html>

Tags:

Html Example