1. Download our Official Android App: Forums for Android!

Apps How to bold a word in the content

Discussion in 'Android Development' started by cb03, May 23, 2010.

  1. cb03

    cb03 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    6
    Joined:
    Apr 27, 2010

    Apr 27, 2010
    6
    0
    5
    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 Lurker
    Rank:
    None
    Points:
    6
    Posts:
    6
    Joined:
    May 23, 2010

    May 23, 2010
    6
    1
    6
    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 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    6
    Joined:
    Apr 27, 2010

    Apr 27, 2010
    6
    0
    5
    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...