Code example for ActionBarDrawerToggle

Methods: getActionBar, invalidateOptionsMenu

0
 
			private String title;
			 
			/** Called when a drawer has settled in a completely closed state. */ 
			public void onDrawerClosed(View view) {
				getActionBar().setTitle(this.title);
				invalidateOptionsMenu(); // creates call to
											// onPrepareOptionsMenu() 
			} 
 
			/** Called when a drawer has settled in a completely open state. */ 
			public void onDrawerOpened(View drawerView) {
				this.title = getActionBar().getTitle().toString();
				getActionBar().setTitle("Menu");
				invalidateOptionsMenu(); // creates call to
											// onPrepareOptionsMenu() 
			} 
		}; 
 
		getActionBar().setDisplayHomeAsUpEnabled(true);
		getActionBar().setHomeButtonEnabled(true);