In my activity which extends SherlockFragmentActivity I have action bar and have also set actionBar.setDisplayHomeAsUpEnabled(true) to come back to my previous activity. Everything works fine. But when i click on home button, the background color should be applied only to the app icon but it also applies to the "title" on action bar as shown in screen shot. I dont want this to happen. When i click on home button, only the app icon should be click able(background color should be applied only for app icon) and not the title. Any idea how can i do this?
my activity code:
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(some_string);
The standard Android UI pattern is to include the title in the pressed state. However, I think if you followed this link (describing how to add a custom view to the left of an actionbar) How to align items in action bar to the left? , and set the title to empty. The below code worked on my local device
ActionBar action=getActionBar();
action.setDisplayShowCustomEnabled(true);
action.setHomeButtonEnabled(true);
action.setDisplayShowTitleEnabled(false);
TextView title =new TextView(getApplicationContext());
title.setText("Your Title here");
title.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
action.setCustomView(title);