Code example for ActionBarActivity

0
 
import android.os.Bundle; 
import android.support.v7.app.ActionBarActivity; 
import android.view.MenuItem; 
 
public class AboutActivity 
	extends ActionBarActivity 
{ 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
 
		setContentView(R.layout.about_activity); 
		getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
	} 
 
	@Override 
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home:
			finish();