Question

I want to change the back button color in the ActionBar with SherlockActivity. The problem is that I have use DarkActionBar but if I put the following code (to show the back button):

// OnCreate
getSupportActionBar().setDisplayHomeAsUpEnabled(true)
getSupportActionBar().setHomeButtonEnabled(true); 
//
@Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case android.R.id.home:
            onBackPressed();
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }

the back button appear, but appear with dark color and I am using DarkActionBar, so I want to change to light color I have search in internet and I found this:

<item name="android:homeAsUpIndicator">@drawable/ic_action_previous_item</item>

in values/styles, but compiler say me that it requires minimun 11 Api level and my cuestion is: why in Api level lower than 11 I can use back button but I can't change his color? And if I agree

<item name="android:homeAsUpIndicator">@drawable/ic_action_previous_item</item>

in values, for example, v-14 it doesn't work, color is still dark.

what can I do?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top