set Activity Title - Android Activity

Android examples for Activity:Activity Title

Description

set Activity Title

Demo Code


//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);
            }/*from  ww w.j  a va  2 s .  c o  m*/
        }

        activity.setTitle(title);
    }
}

Related Tutorials