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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:29:17+00:00 2026-06-13T09:29:17+00:00

I wanted to try out this funny title bar coloring , but it doesn’t

  • 0

I wanted to try out this funny title bar coloring, but it doesn’t work for me as

getWindow().findViewById(android.R.id.title);

returns null. So I had a look at it with Hierarchy Viewer and found out that the view is called id/action_bar instead. But there’s no R.id.action_bar (autocomplete doesn’t offer it and there’s nothing like this is R.java).

So now I’m doubly confused:

  • Is android.R.id.title sort of obsolete now (I’m using version 16 in my emulator)?
  • Where does id/action_bar come from?
  • What’s the recommended and simple practice w.r.t. compatibility?

Should I get ActionBarSherlock? I originally just wanted to change the title bar color… not fool around with it a lot.

  • 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-13T09:29:18+00:00Added an answer on June 13, 2026 at 9:29 am

    I would recommend using ActionBarSherlock if you’re looking for compatibility with Android versions before API level 14 / Android 4.0.

    Changing the background of the ActionBar is straightforward and is most easily done via styles. See the “Background” section of http://android-developers.blogspot.com/2011/04/customizing-action-bar.html

    You can also change it via code. Put this in your onCreate():

    GradientDrawable gradientDrawable = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[] {Color.RED, Color.GREEN});
    getActionBar().setBackgroundDrawable(gradientDrawable);
    

    Here is a screenshot of this code in action:

    enter image description here

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

Sidebar

Related Questions

I found this link and I wanted to try the carousel example out. I
I wanted to try out this example of a self-hosted webservice (originally written in
I just wanted to try out this code... #include <iostream> #include <stdio.h> #include <string.h>
I wanted to try out TBB's scalable_allocator, but was confused when I had to
I wanted to try out an example you can find here: http://php.net/manual/en/function.include.php , but
net but wanted to try to do this code in ASP.net instead of my
I just started out with Python and wanted to try out tornado. Running the
I just discovered forge and wanted to try it out at once. I closely
I've read about Single-Page Applications recently and wanted to try one out. After watching
I wanted to try to allocate a 4 billion bytes array and this is

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.