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

  • Home
  • SEARCH
  • 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 7021179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:24:58+00:00 2026-05-27T23:24:58+00:00

in my application I would to change background and text colour (for example in

  • 0

in my application I would to change background and text colour (for example in Google Sky Map application you can set the “night mode” that changes background and text colour), how can I do the same thing using the same layout for both changes? I would to change also some text (for example I write Italian words and I would to change it in English words) if it’s possible. Could some help me giving any tutorial, example or code? Thank you so much.

  • 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-05-27T23:24:59+00:00Added an answer on May 27, 2026 at 11:24 pm

    You can programmatically change text and background colors using specific methods on controls like:

    View someView = findById(R.id.someView );
    view.setBackgroundResource( R.drawable.someDrawable );
    

    But that would be one by one. You can create a couple of styles, but unfortunately setting the style of a widget after it’s been constructed is tedious because you’d have to make individual calls just like you did above:

    View someView = findById(R.id.someView );
    (TextView) view).setTextColor(getResources().getColor(R.color.white));
    (TextView) view).setTypeface(Typeface.DEFAULT_BOLD);
    

    Finally there are Themes which are collections of Styles defined in resources that define all of your UI. Themes can be set at once when an activity is created:

    http://developer.android.com/guide/topics/ui/themes.html

    Choosing a style / theme programmatically at run time

    As for text you can easily externalize your text using the strings.xml resource, and keep an italian version and english version, and Android will use the correct version that best corresponds with the user’s locale settings. There is a default strings.xml which will be used if Android can’t find a matching strings resource for the user’s locale. Its usually a good idea to default to english for strings.xml, and create a strings_it.xml for italian.

    http://developer.android.com/guide/topics/resources/index.html

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

Sidebar

Related Questions

I am using a third party application and would like to change one of
How would I change the application identifer for a Flex app?
I would like to be able to change the locale in my Swing application
Under what circumstances (if any) would you allow an application to change its underlying
I am building a DLL that another application would use. I want to store
We are developing a Windows application using C#. We would like to change the
A bit of background. My company has produced an application that takes a SQL
I create a Silverlight OOB application in which I try to change the background
I would like to change the address bar background in either Firefox or Internet
Background : I have a C# Windows Forms application that contains a Windows service

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.