Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9161297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:56:12+00:00 2026-06-17T13:56:12+00:00

Is to possible to have changing text color of multiple text strings in the

  • 0

Is to possible to have changing text color of multiple text strings in the same TextView? Using Html.fromHtml is not working:

textViewPrevChat.append("\n"+Html.fromHtml("<b>Bold string </b>")+somestringhere);

It is printing whole thing in bold. Also, the color attribute in <p> is not working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:56:14+00:00Added an answer on June 17, 2026 at 1:56 pm

    You should use a SpannableString for this. Here is an example method implementing this:

    -This example changes the color of one half of a string, and adjusts the size of another section of the String:

    public static SpannableString categoryText(String label, String text, int colorIn) {
            String strIn = label + " " + text;
            SpannableString ss = new SpannableString(strIn);        
            ss.setSpan(new ForegroundColorSpan(colorIn), 0, label.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
            ss.setSpan(new RelativeSizeSpan(.80f), 0, label.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    
            return ss;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

changing a static resource during runtine is something that sounds not possible. I have
Is it possible have two projects with the same name in flex builder? Here
Is it possible to have multiple backend user group access lists in Typo3? For
Is it possible to have multiple inputs with multiple different mappers in Hadoop MapReduce?
Possible Duplicate: Android : Location.distanceTo not working correctly? I am trying to calculate the
I'd like to make a beautiful multiple choice HTML page. I want to have
Possible Duplicate: Random variable not changing in “for” loop in windows batch file I
I have the following simple code: <div style=float:right> <h2>Header <div style=float:right;background-color:red>my text</div></h2> More text
I have following HTML output which i can not change. I want to specify
Is it possible to have the same servlet perform validation? It seems that one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.