Code example for ActionBar

Methods: setDisplayHomeAsUpEnabled, setHomeButtonEnabled

0
 
		// used in Honeycomb and up 
		if (Build.VERSION.SDK_INT >= ANDROID_V11) {
			ActionBar ac = this.getActionBar();
			if (ac != null) {
				ac.setDisplayHomeAsUpEnabled(true);
				 
				if (Build.VERSION.SDK_INT >= ANDROID_V14) {
					ac.setHomeButtonEnabled(true);
				} 
			} 
		} 
 
		if (savedInstanceState == null) {
            // During initial setup, plug in the details fragment. 
            RemoteFragment details = new RemoteFragment();
            details.setArguments(getIntent().getExtras());
            getSupportFragmentManager().beginTransaction().add(android.R.id.content, details).commit();
        } 
		 
		mSettings.readSettings(this);