Code example for ActionBarActivity

Methods: getSupportActionBar, onCreate

0
package com.haarman.listviewanimations; 
 
import android.os.Bundle; 
import android.support.v7.app.ActionBarActivity; 
import android.view.MenuItem; 
 
public class BaseActivity extends ActionBarActivity { 
 
	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		 
		getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
	} 
	 
	 
	@Override 
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home:
			finish(); 
			return true; 
		default: 
			return super.onOptionsItemSelected(item);
		} 
	}