set ActionBar Home Icon - Android User Interface

Android examples for User Interface:ActionBar

Description

set ActionBar Home Icon

Demo Code

/* ActivityHelper.java//from   ww w.  ja  va  2s. co  m
 * See the file "LICENSE.md" for the full license governing this code.
 */
//package com.java2s;
import android.annotation.TargetApi;
import android.app.ActionBar;

import android.graphics.drawable.Drawable;
import android.os.Build;

public class Main {
    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    private static void setActionBarHomeIcon(ActionBar bar, Drawable icon) {
        bar.setIcon(icon);
    }
}

Related Tutorials