1

I have a problem regarding the actionbar home button.

When my app starts, the home button is not clickable, and does nothing. When I move 1 level in the app, I set home to clickable, and use it as an up button.

When I go back to the main menu, the home button is stuck forever as clickable, altough it does nothing now(as it should). But it still gets highlighted(it should not).

Any ideas how to make the home button not clickable, after it has been set clickable once?

I'm using actionbarsherlock and holo-everywhere if it matters.

Tamas
  • 1,765
  • 1
  • 16
  • 26
  • give your sample code to analyse and provide solution.. – harikrishnan Jul 22 '13 at 09:49
  • In onOptionsItemSelected I've implemented my code at the android.R.id.home itemId. That's all. When the fragment change makes the home button use this event, the home button sticks beeing clickable. – Tamas Jul 24 '13 at 10:09

1 Answers1

0

Try this,

public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item);
switch(item.getItemId())
{

case android.R.id.home:
PreferenceActivity.this.onBackPressed(); //PreferenceActivity is just the activity name, you can change it
break;


}
return true;   
}
Akshat Agarwal
  • 2,837
  • 5
  • 29
  • 49