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 8922083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:44:35+00:00 2026-06-15T06:44:35+00:00

Possible Duplicate: How to set text color of TextView by coding? Here is my

  • 0

Possible Duplicate:
How to set text color of TextView by coding?

Here is my code:

TextView mapTextView = new TextView(contextOverlay);
mapTextView.Text = overlayDetailsForThisOverlay.stringName;

May I please have some help to change the text color for this text.

The documentation appears to show that there is a ‘setTextColor’ method.

I am new to Android programming. Do I need to set up an XML file (I am not sure of how/why to do this).

Thanks

  • 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-15T06:44:37+00:00Added an answer on June 15, 2026 at 6:44 am

    Yes, you should set up an XML file for all of your activities. You can change things programatically when needed but it is usually easier to set these up initially in an XML then use setContentView(R.layout.yourxmlfile) to set your initial UI. See here for more details on layout files. In the XML, you can set your text color and many other attributes and change them in your Java code if needed. I don’t know what your contextOverlay is but you would want to declare your TextView with something like

    TextView mapTextView = (TextView) findViewById(R.id.nameofid)
    You should put all of your layouts for UI’s in the layout folder and any hard-coded words should be in the res/values/strings folder and accessed there from your XML layouts. Go through the documentation and it will show you how to set all of that up

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: C# How can I set the color of text in a richtextbox?
Possible Duplicate: Why write <script type=“text/javascript”> when the mime type is set by the
Possible Duplicate: Can i set property of Textview like justify? I'm writing an android
Possible Duplicate: How To Set Text In An EditText how can we assign value
Possible Duplicate: CKEditor - Set cursor position to end of text I have a
Possible Duplicate: How do I center text horizontally and vertical in a TextView in
Possible Duplicate: Google Calendar API - PHP - set event’s color How do you
Possible Duplicate: Highlighting strings in JavaFX TextArea TextArea text = new TextArea(); text.setText(select from);
Possible Duplicate: Arabic text support for Android Emulator I would like to set arabic
Possible Duplicate: Set Locale programatically I would like to create an english/spanish option choice

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.