Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

Thanks!

like image 600
Synergy807 Avatar asked Dec 05 '22 10:12

Synergy807


1 Answers

The solution to this problem is to use the method:

setDrawerIndicatorEnabled(boolean enable)

inside the ActionBarDrawerToggle class.

like image 113
Synergy807 Avatar answered Dec 06 '22 23:12

Synergy807