Android examples for User Interface:ActionBar Color
set ActionBar Color Form Res
//package com.java2s; import android.app.Activity; import android.content.Context; import android.graphics.drawable.ColorDrawable; public class Main { public static void setActionBarColorFormRes(Context context, Activity activity, int color) { activity.getActionBar().setBackgroundDrawable( new ColorDrawable(context.getResources().getColor(color))); activity.getActionBar().setDisplayShowTitleEnabled(false); activity.getActionBar().setDisplayShowTitleEnabled(true); refreshActionBar(activity);//w ww .j a v a 2 s. c om } public static void refreshActionBar(Activity activity) { activity.getActionBar().setDisplayShowTitleEnabled(false); activity.getActionBar().setDisplayShowTitleEnabled(true); } }