OK, that was a clumsy title :(
Here's the description of the problem. There are two Activities: MainActivity & PreferenceActivity.
The MainActivity has drawer set up (per tutorial) and working fine (behavior, three-line icon, everything).
The problem is that the PreferenceActivity also shows the R.drawable.ic_drawer
, this is not as intended.
Intended behavior is to have < icon in the PreferenceActivity action bar.
The only changes to PreferenceActivity are:
onCreate()
I have addedgetSupportActionBar().setDisplayHomeAsUpEnabled(true);
and- I have overriden
onOptionsItemSelected()
(to handleandroid.R.id.home
click to track some analytics).
I have tried suggestions from this question. Based on that, I have added setDrawerIndicatorEnabled(true);
in the MainActivity.onResume()
and have added setDrawerIndicatorEnabled(false);
in MainActivity.onPause()
, but w/o any effect.
Ideas hove to solve this?
Could it be that the setDrawerIndicatorEnabled(false) doesn't correctly revert the indicator because ActionBarSherlock defines the attribute for it (in its theme) as "homeAsUpIndicator" and not as "android.R.attr.homeAsUpIndicator" (as described here)?