set Activity Title - Android android.app

Android examples for android.app:Activity

Description

set Activity Title

Demo Code

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  ava2  s.  com*/
    }

    activity.setTitle(title);
  }

}

Related Tutorials