Android examples for User Interface:ActionBar Title
Set the ActionBar title
//package com.java2s; import android.app.ActionBar; import android.app.Activity; public class Main { /**//from ww w . ja va 2 s . c om * Set the ActionBar title * * @param title The title to set * @param activity The current Activity */ public static void setActionBarTitle(Activity activity, String title) { ActionBar actionBar = activity.getActionBar(); if (actionBar != null && title != null && !title.equals("")) { actionBar.setTitle(title); } else if (actionBar != null && title != null && title.equals("")) { actionBar.setDisplayShowTitleEnabled(false); // we don't want a title } } }