set Display Home As Up Enabled - Android User Interface

Android examples for User Interface:Display

Description

set Display Home As Up Enabled

Demo Code


//package com.java2s;
import android.app.ActionBar;
import android.app.Activity;
import android.os.Build;

public class Main {
    public static void setDisplayHomeAsUpEnabled(Activity activity,
            boolean enabled) {
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) {
            ActionBar actionBar = activity.getActionBar();
            //noinspection ConstantConditions
            actionBar.setDisplayHomeAsUpEnabled(enabled);
        }//from  w  ww. jav  a 2 s  .co  m
    }
}

Related Tutorials