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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:12:39+00:00 2026-05-13T19:12:39+00:00

In my android application I want the standard/basic title bar to change color. To

  • 0

In my android application I want the standard/basic title bar to change color.

To change the text color you have setTitleColor(int color), is there a way to change the background color of the bar?

  • 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-13T19:12:39+00:00Added an answer on May 13, 2026 at 7:12 pm

    This thread will get you started with building your own title bar in a xml file and using it in your activities

    Edit

    Here is a brief summary of the content of the link above – This is just to set the color of the text and the background of the title bar – no resizing, no buttons, just the simpliest sample

    res/layout/mytitle.xml – This is the view that will represent the title bar

    <?xml version="1.0" encoding="utf-8"?>
    <TextView
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/myTitle"
      android:text="This is my new title"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:textColor="@color/titletextcolor"
       />
    

    res/values/themes.xml – We want to keep the default android theme and just need to change the background color of the title background. So we create a theme that inherits the default theme and set the background style to our own style.

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="customTheme" parent="android:Theme"> 
            <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item>   
        </style> 
    </resources>
    

    res/values/styles.xml – This is where we set the theme to use the color we want for the title background

    <?xml version="1.0" encoding="utf-8"?>
    <resources> 
       <style name="WindowTitleBackground">     
            <item name="android:background">@color/titlebackgroundcolor</item>                   
        </style>
    </resources>
    

    res/values/colors.xml – Set here the color you want

    <?xml version="1.0" encoding="utf-8"?>
    <resources>   
        <color name="titlebackgroundcolor">#3232CD</color>
        <color name="titletextcolor">#FFFF00</color>
    </resources>
    

    In the AndroidMANIFEST.xml, set the theme attribute either in the application (for the whole application) or in the activity (only this activity) tags

    <activity android:name=".CustomTitleBar" android:theme="@style/customTheme" ...
    

    From the Activity (called CustomTitleBar) :

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    
            requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
            setContentView(R.layout.main);
            getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle);
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android application that I want to always be running in landscape
I have a single Android application that houses a suite of applications. I want
I have an Android Application which uses JNI calls. Now i want this application
I am building an android application and want to know if there is a
I have two threads in an Android application, one is the view thread, and
I'm building an Android app and I want to copy the text value of
I in my android application I want to track GPS information and use this
I'm developing an Android application where I want to pin out certain spots/addresses on
I am working on an android application and I want to send an SMS
It seems as if every Android application I really want to make is impossible

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.