Synergy807 Synergy807 - 6 months ago 18
Android Question

Setting Navigation Icon on Android ActionBar

So I'm working on adding ActionBarSherlock and the Navigation Drawer to a project that previously implemented a custom (very poorly written) "action bar". Instead of using fragments and a backstack of activities for navigation, some activities show and hide different layouts. (That is, suppose I am in a list mode and then select a button to go into an edit screen. The app currently hides the list layout and shows another layout.).

So I've added actionbar sherlock and a navigation drawer to all the activities. I want to be able to programmatically switch the navigation icon from the 3 lines to the arrow when certain buttons are pressed.

enter image description here

I can't figure out how to do this though. Any ideas?



The solution to this problem is to use the method:

setDrawerIndicatorEnabled(boolean enable)

inside the ActionBarDrawerToggle class.