customize ActionBar - Android User Interface

Android examples for User Interface:ActionBar

Description

customize ActionBar

Demo Code


//package com.java2s;
import android.app.ActionBar;

public class Main {
    public static void customizeActionBar(ActionBar actionBar, int resId) {
        actionBar.setCustomView(resId);/*from w w  w.  ja va  2s .  c  om*/
        actionBar.setHomeButtonEnabled(false);
        actionBar.setDisplayHomeAsUpEnabled(false);
        actionBar.setDisplayShowTitleEnabled(false);
        actionBar.setDisplayShowCustomEnabled(true);
        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
    }
}

Related Tutorials