Android: ActionBar home up button

To create a little back or up icon near your icon on the action bar, call getActionBar().setDisplayHomeAsUpEnabled(true);

In the onMenuItemSelected method, listen for the item. Then either finish() the activity to go back to previous one, or start a new activity if you want.


	public boolean onMenuItemSelected(int featureId, MenuItem item) {

	    switch (item.getItemId()) {



				return true;	    




	    return super.onMenuItemSelected(featureId, item);

android android-actionbar

Edit on github
comments powered by Disqus
Click me