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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:11:31+00:00 2026-06-16T02:11:31+00:00

I cannot figure out how to change the action bar items onPressed color on

  • 0

I cannot figure out how to change the action bar items “onPressed” color on Android. I’m not talking about the action bar background color but about the blue over state. How can I change the color of this or at least get rid of it? For instance the App Icon with the homeAsUpIndicator.

I tried to change the action bar style and also the menu item style but nothing worked.

Thanks

EDIT
Here is my implementation so far:

My style xml:

<style name="Theme.AppTheme" parent="@android:style/Theme.Holo">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
    <item name="android:selectableItemBackground">@android:color/transparent</item>
    <item name="android:windowEnterAnimation">@anim/fadein</item>
    <item name="android:windowExitAnimation">@anim/fadeout</item>        
    <item name="android:actionBarItemBackground">@android:color/transparent</item>
</style>

<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">@drawable/actionbarheader</item>
    <item name="android:backgroundStacked">@drawable/actionbarheader</item>
    <item name="android:backgroundSplit">@drawable/actionbarheader</item>
    <item name="android:titleTextStyle">@style/ActionBarTitle</item>
    <item name="android:actionBarItemBackground">@android:color/transparent</item>
    <item name="android:actionButtonStyle">@style/MyActionButtonStyle</item>
    <item name="android:homeAsUpIndicator">@drawable/actionbarlogo</item>
    <item name="android:icon">@drawable/app_icon</item>>
</style>

<style name="ActionBarTitle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textSize">20sp</item>
</style>

<style name="MyActionButtonStyle" parent="@android:style/Widget.Holo.Light.ActionButton">
    <item name="android:background">@android:color/transparent</item>
</style>

Then I have a drawable for the actionbarogo:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:drawable="@drawable/actionbarlogo_on" android:state_pressed="true"/>
  <item android:drawable="@drawable/actionbarlogo_on" android:state_focused="true"/>
  <item android:drawable="@drawable/actionbarlogo_off"/>
</selector>

My menu xml for the action bar items:

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/ContactsMode"
        android:icon="@drawable/actionbarcontacts"
        android:title="@string/contacts"
        android:orderInCategory="100"
        android:showAsAction="always"
        android:background="@android:color/transparent" />
</menu>

and finally, the item’s drawable:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:drawable="@drawable/actionbarcontacts_on" android:state_pressed="true"/>
  <item android:drawable="@drawable/actionbarcontacts_on" android:state_focused="true"/>
  <item android:drawable="@drawable/actionbarcontacts_off"/>
</selector>

Here is how I create the Menu Items for the ActionBar:

public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_menu, menu);
        actionBar.setIcon(R.drawable.actionbarlogo);
        return true;
    }

    public boolean onPrepareOptionsMenu(Menu menu) {        
         MenuItem item= menu.findItem(R.id.ContactsMode);
         if(ContactsButton)
             item.setVisible(true);      
         else
            item.setVisible(false);

         return true;   
    }
  • 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-16T02:11:32+00:00Added an answer on June 16, 2026 at 2:11 am

    Fixed it. There was a parent activity changing the theme in the onCreate method…

    I didn’t know that you could set the theme programmatically within the activity with:

    setTheme(R.style.MyTheme);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read a ton about this problem, but I cannot figure it out.
Basically, I cannot figure out how to change the background image. I have searched
I cannot figure out how to change the title bar icon (the icon in
Cannot figure out, where to change EOF in PyCharm. My scripts start with :
I cannot figure out how to get rid of errors that should not be
I have installed MacVim but I cannot figure out how to do some formatting
I have a question that might seem basic but I just cannot figure out
I'm pretty sure i'am almost there....but i cannot figure out how to iterate through
I cannot figure out why my calculation is not working. I am doing for
I think I'm having a brain freeze here but I cannot figure out the

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.