Java tutorial
//package com.java2s; import android.app.Activity; public class Main { private static final String TITLE_ENTRIES_SEPARATOR = ": "; public static final void setActivityTitle(Activity activity, int... ids) { StringBuilder title = new StringBuilder(); for (int i = 0; i < ids.length; i++) { title.append(activity.getString(ids[i])); if (i < ids.length - 1) { title.append(TITLE_ENTRIES_SEPARATOR); } } activity.setTitle(title); } }