How to bold a word in the content


Last Updated:

  1. cb03

    cb03 Member This Topic's Starter

    Joined:
    Apr 27, 2010
    Messages:
    6
    Likes Received:
    0
    Suppose I have a Textview and I want to bold the word I want in the content, so How can I do that????????
    Anybody help????????/
    thanks!
     

    Advertisement
  2. orangic

    orangic Member

    Joined:
    May 23, 2010
    Messages:
    6
    Likes Received:
    1
    Try this:

    Code (Text):
    1.  
    2. TextView textView = (TextView)findViewById(R.id.textView);
    3. textView.setText(Html.fromHtml("<b>Bold</b> Text"));
    4.  
     
  3. cb03

    cb03 Member This Topic's Starter

    Joined:
    Apr 27, 2010
    Messages:
    6
    Likes Received:
    0
    I try that code but the content of textview changed. I don't want it's change. I just want to bold a word in the content. For example, I have a textview with the content :
    "I want to bold this word"
    and I want it's will appearance :
    "I want to bold this word"


    Can u help me??????????
     

Share This Page

Loading...