From a557fdcfb855f3183c687d988a56f4f9ed3b0767 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 21 Aug 2014 18:05:53 -0700 Subject: [PATCH] Directly propagate Activity titles to action bars Window decor action bars already inherit window title changes if no explicit action bar title has been set but from an Activity's perspective setting the activity title is a stronger signal. This is especially relevant when the activity's action bar has been provided by the application in the form of a Toolbar. Bug 17138048 Change-Id: Ibf042cab6bbda3dc29590c09d1a0910b6ba78870 --- core/java/android/app/Activity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index f5ac5f7ee1c4c..ffcdcf7feee32 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -5021,6 +5021,9 @@ public class Activity extends ContextThemeWrapper } } } + if (mActionBar != null) { + mActionBar.setTitle(title); + } } protected void onChildTitleChanged(Activity childActivity, CharSequence title) {