I am implementing an action bar with ActionBarSherlock with an ActionBarDrawerToggle. It is supposed to display an hamburger button on the left side of the action bar. It is working well on higher api level (Tested on devices above api level 16). However it doesn't work on an Android 2.3.7 device (api 10). On this device, a left caret (<) is displayed. I searched the internet but seems this is not a common issue. So I am sure if I am doing something wrong:
Here is how I handle the ActionBarDrawerToggle in my code:
public class MyActivity extends SherlockFragmentActivity {
private ActionBarDrawerToggle drawerToggle;
private MySidebarDrawerLayout sidebarDrawerLayout;
...
@Override
protected final void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home);
// init side bar drawer
sidebarDrawerLayout = (SidebarDrawerLayout)
findViewById(R.id.sidebar_drawer_layout);
drawerToggle = new ActionBarDrawerToggle(this, sidebarDrawerLayout, R.drawable.hamburger, R.string.drawer_open,R.string.drawer_close) {
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
}
@Override
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
}
};
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
...
}
}
So why the hamburger is not showing on lower api?